-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
76 lines (63 loc) · 1.53 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
image: python:3.10
before_script:
- python --version
- pip install -e ".[dev]"
# jobs extending .scheduled_only only run in scheduled pipelines not on every commit
.scheduled_only:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Checking codestyle
.codestyle:
stage: test
script:
- flake8 --version
- mypy --version
- black --version
- flake8
- mypy --config-file mypy.ini
- black . --check --verbose --diff --color
codestyle:
extends:
- .codestyle
codestyle:python_compatibility:
extends:
- .codestyle
- .scheduled_only
image: python:3.8
# Running tests
test_and_coverage:
script:
- coverage run -m pytest
- coverage report
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
test:python_compatibility:
extends:
- .scheduled_only
image: python:3.8
script:
- python -m pytest .
test:torch_backwards_compatibility:
image: python:3.7
script:
- pip install torch==1.9.0 torchvision==0.10.0
- python -m pytest .
# Documentation
test_build_doc:
stage: test
script:
- apt-get update && apt-get install -y pandoc
- sphinx-build -b html docs/source/ docs/build/ -a
test_doc_completeness:
extends: .scheduled_only
stage: test
allow_failure: true
script:
- flake8 --version
# explicitly select Docstring errors and ignore to overwrite config in setup.cfg
- flake8 --select=D1 --ignore=E501