forked from ModioAB/caramel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
77 lines (70 loc) · 1.59 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
---
# 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 "Branch pipelines" definition,
# but with an exception of "push" to avoid duplicates
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: never
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
stages:
- test
- rebase
caramel:test:
stage: test
when: always
image: ${PYTHON_IMAGE}
before_script:
- pip3 install .
script:
- python3 -m unittest discover
- make systest
rebase:test:
extends: .rebase
stage: rebase
needs:
- caramel:test
script:
- pip3 install .
- git every
-x 'pip3 install --editable .'
-x 'flake8 caramel/ tests/'
-x 'black --check caramel/ tests/'
caramel:black:
stage: test
when: always
image: ${PYTHON_IMAGE}
before_script:
- pip3 install black
script:
- black --check --diff caramel/ tests/
caramel:flake:
stage: test
when: always
image: ${PYTHON_IMAGE}
before_script:
- pip3 install flake8
script:
- flake8 caramel/ tests/
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 'pip3 install --editable .'
-x 'flake8 caramel/ tests/'
-x 'black --check caramel/ tests/'