-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
103 lines (90 loc) · 2.31 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
stages:
- test
# Global default parameters set for all jobs unless overridden by job-specific
# configuration.
default:
image: python:3.9-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"
###############################################################################
# Run Conditions
#
# Run rules to activate at the major junction points: merge requests, tag
# pipelines and branch pipelines for masters.
.run_automatically:
rules:
- if: $CI_MERGE_REQUEST_IID
when: on_success
- if: $CI_COMMIT_TAG
when: on_success
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: on_success
- when: never # explicit fail-exclude terminal condition.
# Rules for running
# TODO: When moving to enforcing forky workflow, this will not be necessary.
.run_on_masters:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: on_success
- when: never
###############################################################################
# Jobs -- Testing
.test_job_defaults:
extends: .run_automatically
stage: test
tags:
- linux
- docker
- test
- smqtk
before_script:
- export PATH=${HOME}/.local/bin:${PATH}
- pip install --user -U poetry
- command -v python
- python --version
- command -v pip
- pip --version
- command -v poetry
- poetry -V
- poetry install
test:docs_build:
extends: .test_job_defaults
script:
- cd docs
- poetry run make html
- stat _build/html/index.html
test:lint:
extends: .test_job_defaults
script:
- poetry run flake8
test:typecheck:
extends: .test_job_defaults
script:
- poetry run mypy
test:unittests:
extends: .test_job_defaults
parallel:
matrix:
- IMAGE: [
"python:3.6-buster",
"python:3.7-buster",
"python:3.8-buster",
"python:3.9-buster"
]
# Extras for included, optional plugin support (space-separated lists)
OPT_EXTRA: [
"", # no extras
"sklearn",
]
image: $IMAGE
script:
- |
if [[ -n "$OPT_EXTRA" ]]
then
poetry install --extras "$OPT_EXTRA"
fi
- poetry run pytest --cov=smqtk_detection --cov-config=.pytest.coveragerc