-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
93 lines (75 loc) · 1.54 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
image:
name: python:3.8
variables:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache/pip
- .venv
stages:
- quality
- tests
- deploy
# Jobs templates
# --------------
.quality-template: &quality
stage: quality
interruptible: true
before_script:
- pip install pre-commit
- pre-commit install
.unit-test-template: &unit-test
stage: tests
interruptible: true
coverage: '/TOTAL.*\s(\d+\.\d+\%)/'
before_script:
- apt-get update
- apt-get install -y libportaudio2
- pip install poetry
- poetry --version
- poetry config virtualenvs.in-project true
- poetry install -vv
script:
- poetry run pytest --showlocals
# Quality jobs
# ------------
pre-commits:
<<: *quality
script: pre-commit run --all-files
# Unit tests jobs
# ---------------
unit-tests/3.8:
<<: *unit-test
image: python:3.8
coverage: '/^TOTAL.+?(\d+\%)$/'
unit-tests/3.9:
<<: *unit-test
image: python:3.9
unit-tests/3.10:
<<: *unit-test
image: python:3.10
unit-tests/missing backends:
<<: *unit-test
script:
# no ipython
- poetry run pip uninstall --yes ipython
- poetry run pytest --showlocals
# no Port Audio backend
- apt-get remove -y libportaudio2
- poetry run pytest --showlocals
pages:
stage: deploy
interruptible: true
image: python:3.10
before_script:
- pip install poetry
- poetry install
script:
- poetry run mkdocs build --strict --verbose
- mv site public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH