-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
114 lines (96 loc) · 2.48 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
variables:
TZ: "America/New_York"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
APT_CACHE_DIR: "$CI_PROJECT_DIR/apt-cache"
cache:
paths:
- "$CI_PROJECT_DIR/.cache/pip"
- "$CI_PROJECT_DIR/apt-cache"
before_script:
- mkdir -pv $APT_CACHE_DIR
stages:
- testing
- publish
.unit_tests_base:
stage: testing
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install $PIP_FLAGS .[test]
- source venv/bin/activate
- mkdir run_from
- cd run_from && mkdir logs && pytest ../tests/ --capture=sys -v --cov=../giteasychangelog --color=yes --disable-warnings --junitxml=report.xml
- cp report.xml ../
artifacts:
reports:
junit: report.xml
paths:
- dist/*
- run_from/logs/*
expire_in: 7 days
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^.*ci-test.*$/'
when: never
- when: on_success
.latest_unit_test_base:
extends: .unit_tests_base
before_script:
.alpha_unit_test_base:
extends: .unit_tests_base
variables:
PIP_FLAGS: --pre
allow_failure: true
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^(dev|master)$/'
when: on_success
- if: '$TEST_ALPHA'
when: on_success
unit_test 3.5:
extends: .latest_unit_test_base
image: python:3.5
unit_test 3.6:
extends: .latest_unit_test_base
image: python:3.6
unit_test 3.7:
extends: .latest_unit_test_base
image: python:3.7
unit_test 3.8:
extends: .latest_unit_test_base
image: python:3.8
unit_test 3.9:
extends: .latest_unit_test_base
image: python:3.9-rc
allow_failure: true
alpha_unit_test 3.5:
extends: .alpha_unit_test_base
image: python:3.5
allow_failure: true
alpha_unit_test 3.6:
extends: .alpha_unit_test_base
image: python:3.6
allow_failure: true
alpha_unit_test 3.7:
extends: .alpha_unit_test_base
image: python:3.7
allow_failure: true
alpha_unit_test 3.8:
extends: .alpha_unit_test_base
image: python:3.8
allow_failure: true
alpha_unit_test 3.9:
extends: .alpha_unit_test_base
image: python:3.9-rc
allow_failure: true
publish_pypi:
image: python:3
stage: publish
script:
- apt-get update -qy
- apt-get install twine -y
- python setup.py sdist bdist_wheel
- twine upload -u $PYPI_USER -p $PYPI_PASS dist/* --verbose
rules:
- if: '$CI_COMMIT_TAG'
when: on_success