-
Notifications
You must be signed in to change notification settings - Fork 58
/
.gitlab-ci.yml
97 lines (83 loc) · 2.4 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
stages:
- test
# Global default parameters set for all jobs unless overridden by job-specific
# configuration.
default:
image: python:3.6-buster
interruptible: true
# Global default variables set for all jobs unless overridden by job-specific
# configuration.
variables:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
# Common job specification not otherwise specifiable in the `default` section
# above.
.test_job_defaults:
stage: test
tags:
- linux
- docker
- test
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
- when: never # explicit fail-exclude terminal condition.
# Common setup script lines for test jobs
.test_setup: &test_setup
- apt-get -y update
- python --version
- pip install -U pip
- pip install --use-feature=2020-resolver
-r requirements.txt
-e .
###############################################################################
# Jobs
#build:
# stage: build
# script:
# - echo "Placeholder for any build operations required."
test:build_docs:
extends: .test_job_defaults
script:
- *test_setup # expand `&test_setup` anchor above into here.
- cd docs
- make html
- stat _build/html/index.html
test:py36:
extends: .test_job_defaults
script:
- *test_setup # expand `&test_setup` anchor above into here.
- pytest --cov=smqtk --cov-config=.pytest.coveragerc
test:py37:
extends: .test_job_defaults
image: python:3.7-buster
script:
- *test_setup # expand `&test_setup` anchor above into here.
- pytest --cov=smqtk --cov-config=.pytest.coveragerc
test:py38:
extends: .test_job_defaults
image: python:3.8-buster
script:
- *test_setup # expand `&test_setup` anchor above into here.
- pytest --cov=smqtk --cov-config=.pytest.coveragerc
test:lint:
extends: .test_job_defaults
script:
- *test_setup # expand `&test_setup` anchor above into here.
- flake8
test:typecheck:
extends: .test_job_defaults
script:
- *test_setup
- mypy
test:added_a_change_note:
extends: .test_job_defaults
script:
- TARGET=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- |
FOUND=$(git diff --name-status --diff-filter=d ${TARGET} HEAD | grep "^\w\s*docs/release_notes/pending" || echo "")
if [[ "$FOUND" = "" ]]
then
echo "No \"pending_*\" change notes files have been modified. Please add a change note!"
exit 1
fi