-
Notifications
You must be signed in to change notification settings - Fork 48
/
.gitlab-ci.yml
73 lines (64 loc) · 1.13 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
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "web"
- when: never
stages:
- analyse
- test
- build
- release
image: python:3.9
pre-commit:
stage: analyse
before_script:
- set -x
- echo $PWD
- pip install poetry
- poetry install
script:
- poetry run pre-commit run --all-files --color=always
cache:
key: pre-commit
paths:
- ~/.cache/pre-commit
.test: &test
stage: test
before_script:
- pip install poetry
- poetry install
script:
- poetry run py.test
test-python3.7:
image: python:3.7
<<: *test
test-python3.8:
image: python:3.8
<<: *test
test-python3.9:
image: python:3.9
<<: *test
build:
stage: build
before_script:
- pip install poetry
- poetry install
script:
- poetry build
artifacts:
paths:
- dist/
expire_in: 30 days
rules:
- if: $CI_COMMIT_TAG
release:
stage: release
dependencies:
- build
before_script:
- pip install poetry
script:
- echo $PYPI_USERNAME
- poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD
rules:
- if: $CI_COMMIT_TAG