-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
129 lines (113 loc) · 2.16 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
stages:
- checks
- tests
- release
- publish_doc
variables:
DOCKER_IMAGE: "registry.duniter.org/docker/python3/poetry"
PYTHON_VERSION: "3.8"
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
.code_changes:
only:
changes:
- duniterpy/**/*.py
- tests/**/*.py
- examples/*.py
.changes:
rules:
- changes:
- duniterpy/**/*.py
- tests/**/*.py
- examples/*.py
- .gitlab-ci.yml
- Makefile
- pyproject.toml
format:
extends:
- .code_changes
stage: checks
script:
- make check-format
build:
extends:
- .changes
stage: checks
script:
- poetry build
type:
extends:
- .code_changes
stage: checks
script:
- make mypy
lint:
extends:
- .code_changes
stage: tests
tags: [redshift]
script:
- poetry install
- make pylint
.tests:
extends: .changes
stage: tests
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
script:
- poetry install --no-dev
- make tests
tests-3.6:
extends: .tests
tags: [mille]
variables:
PYTHON_VERSION: "3.6"
tests-3.7:
extends: .tests
tags: [mille]
variables:
PYTHON_VERSION: "3.7"
tests-3.8:
extends: .tests
tags: [redshift]
tests-3.9:
extends: .tests
tags: [redshift]
variables:
PYTHON_VERSION: "3.9"
release:
stage: release
script:
- poetry publish --build --username $PYPI_LOGIN --password $PYPI_PASSWORD
rules:
- if: $CI_COMMIT_TAG
when: manual
- if: $CI_COMMIT_BRANCH == "master"
when: manual
- when: never
release_test:
stage: release
script:
- poetry config repositories.pypi_test https://test.pypi.org/legacy/
- poetry publish --build --username $PYPI_TEST_LOGIN --password $PYPI_TEST_PASSWORD --repository pypi_test
rules:
- if: $CI_COMMIT_TAG
when: manual
- if: $CI_COMMIT_BRANCH == "dev"
when: manual
- when: never
pages:
stage: publish_doc
script:
- poetry install
- make docs
- mv docs/_build/html public
- ls public
artifacts:
untracked: true
paths:
- public
rules:
- if: $CI_COMMIT_TAG
when: manual
- if: $CI_COMMIT_BRANCH == "master"
when: manual
- when: never