-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
96 lines (89 loc) · 2.07 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
# stages of gitlab ci.
stages:
- test
- release
# default settings for all ci jobs.
default:
image: azadehafzarhub/gitlab-ci-python-build:latest
# job for testing package against python version 3.6
# on master branch and send test coverage result to
# codeclimate.
test main branch:
stage: test
before_script:
# run code climate test reporter agent.
- cc-test-reporter before-build
# get bash ready.
- source ~/.bash_profile
# create virtual environment.
- pipenv --python 3.6.9
# install dependencies from the pipfile.
- pipenv install --dev
# run tests.
script:
- script/test.sh
# send test coverage result to codeclimate.
after_script:
- cc-test-reporter after-build --coverage-input-type coverage.py
only:
- master
# job for testing package on other branches than master
# and merge requests against 3.6 version.
test python 3.6.9:
stage: test
before_script:
# get bash ready.
- source ~/.bash_profile
# create virtual environment.
- pipenv --python 3.6.9
# install dependencies from the pipfile.
- pipenv install --dev
# run tests.
script:
- script/test.sh
only:
- branches
- merge_requests
except:
- master
test python 3.7.5:
stage: test
before_script:
# get bash ready.
- source ~/.bash_profile
# create virtual environment.
- pipenv --python 3.7.5
# install dependencies from the pipfile.
- pipenv install --dev
# run tests.
script:
- script/test.sh
except:
- tags
test python 3.8.0:
stage: test
before_script:
# get bash ready.
- source ~/.bash_profile
# create virtual environment.
- pipenv --python 3.8.0
# install dependencies from the pipfile.
- pipenv install --dev
# run tests.
script:
- script/test.sh
except:
- tags
# deploy package to pypi whenever a tag is released.
release to pypi:
stage: release
before_script:
# create a source list.
- python3 setup.py sdist
script:
# upload to pypi.
- twine upload dist/*
# only run for new tags.
only:
- tags
when: manual