-
Notifications
You must be signed in to change notification settings - Fork 118
/
.gitlab-ci.yml
94 lines (81 loc) · 1.78 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
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POETRY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pypoetry"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
cache:
key:
files:
- .gitlab-ci.yml
- poetry.lock
prefix: relate
paths:
- ".cache/pypoetry"
- ".cache/pip"
- ".venv"
stages:
- setup
- lint
- tests
- docs
.install-deps-template: &install-deps
image: inducer/ci-base-image
tags:
- docker-runner
before_script:
- curl -sSL https://install.python-poetry.org | python3 -
- export PATH="$HOME/.local/bin:$PATH"
- poetry install
.quality-template: &quality
<<: *install-deps
stage: lint
except:
- tags
.test-template: &test
<<: *install-deps
script:
- "bash ./.ci/run-tests-for-ci.sh"
stage: tests
except:
- tags
coverage: "/TOTAL.+ ([0-9]{1,3}%)/"
setup:
<<: *install-deps
stage: setup
script: poetry config --list
ruff:
<<: *quality
script: |
poetry run ruff check
mypy:
<<: *quality
variables:
RELATE_LOCAL_TEST_SETTINGS: './local_settings_example.py'
script: poetry run ./.ci/run-mypy.sh
safety:
<<: *quality
script: poetry run ./.ci/run-safety.sh
Python 3:
<<: *test
needs: [setup]
Python 3 Expensive:
<<: *test
variables:
RL_CI_TEST: expensive
needs: [setup]
Python 3 CLI Tool:
<<: *test
script:
- git clone https://github.com/inducer/relate-sample
- cd relate-sample
- poetry run relate validate .
- poetry run relate test-code questions/autograded-python-example.yml
- poetry run relate expand-yaml flows/quiz-test.yml > /dev/null
needs: [setup]
Documentation:
<<: *install-deps
stage: docs
variables:
RELATE_LOCAL_TEST_SETTINGS: './local_settings_example.py'
script:
- poetry run bash ./doc/build-docs.sh
needs: [setup]