-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
111 lines (99 loc) · 2.64 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
---
# Keep the includes first to illustrate that definitions that everything that
# follows override included definitions.
include:
# https://docs.gitlab.com/ee/ci/yaml/README.html#includefile
- project: ModioAB/CI
ref: main
file:
- /ci/default.yml
- /ci/rebase.yml
workflow:
# Similar to "MergeRequest-Pipelines" default template.
# Adds extra "EXTERNAL_PULL_REQUEST_IID"
# see: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Workflows/MergeRequest-Pipelines.gitlab-ci.yml
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_EXTERNAL_PULL_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH
stages:
- test
- rebase
caramel:test:
stage: test
image: ${PYTHON_IMAGE}
before_script:
- python3 -m pip install .
script:
- python3 -m unittest discover
caramel:test:deprecation:
extends: caramel:test
allow_failure: true
script:
- python3 -W error::DeprecationWarning -m unittest discover
caramel:systest:
stage: test
image: ${BUILD_IMAGE}
before_script:
- python3 -m pip install .
- dnf -y install openssl
- test -e /etc/machine-id || echo f26871a049f84136bb011f4744cde2dd > /etc/machine-id
script:
- make systest
rebase:test:
extends: .rebase
stage: rebase
needs:
- caramel:test
script:
- python3 -m pip install .
- git every
-x 'python3 -m pip install --editable .'
-x 'flake8 caramel/ tests/'
-x 'black --check caramel/ tests/'
caramel:black:
stage: test
image: ${PYTHON_IMAGE}
before_script:
- python3 -m pip install black
script:
- black --check --diff caramel/ tests/
caramel:flake:
stage: test
image: ${PYTHON_IMAGE}
before_script:
- python3 -m pip install flake8
script:
- flake8 caramel/ tests/
caramel:mypy:
stage: test
when: always
image: ${PYTHON_IMAGE}
before_script:
- python3 -m pip install mypy "sqlalchemy[mypy]<2"
script:
- mypy --install-types --non-interactive --config-file=setup.cfg caramel/ tests/
caramel:pylint:
stage: test
when: always
image: ${PYTHON_IMAGE}
before_script:
- python3 -m pip install pylint pylint-exit
- python3 setup.py develop
script:
- pylint --rcfile=setup.cfg caramel/ tests/ || pylint-exit --error-fail $?
rebase:check:
extends: .rebase
stage: rebase
needs:
- caramel:flake
- caramel:black
script:
- python3 -m pip install black flake8
# Always install "." first to track possible dependency changes
- git every
-x 'python3 -m pip install --editable .'
-x 'flake8 caramel/ tests/'
-x 'black --check caramel/ tests/'