-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
80 lines (68 loc) · 1.79 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
80 lines (68 loc) · 1.79 KB
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
default:
image: python:3.11
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
stages:
- format
- lint
- test
# -------------------------------------------------------------------
# Format stage
# -------------------------------------------------------------------
format-python:
stage: format
script:
- pip install --upgrade pip
- pip install ruff --quiet
- ruff format src evaluation examples experiments --check
# -------------------------------------------------------------------
# Linting stage
# -------------------------------------------------------------------
sort-imports:
stage: lint
script:
- pip install isort --quiet
- isort src --check-only
python-lint-ruff:
stage: lint
script:
- pip install ruff
- ruff check src evaluation examples experiments
python-pylint:
stage: lint
script:
- pip install ".[dev,eval]" --quiet
- pylint --fail-under=9.8 src
- pylint --fail-under=9 experiments
- pylint --fail-under=9 examples
python-codequality:
stage: lint
script:
- pip install --upgrade pip
- pip install ".[dev]" --quiet
- mypy src
jupyter_clean:
stage: lint
script:
- pip install nb-clean --quiet
- nb-clean check evaluation/notebooks
shellcheck:
image: koalaman/shellcheck-alpine:latest
stage: lint
before_script:
- apk update
- apk add git
script:
- find ./scripts -type f -name '*.sh' | xargs shellcheck --severity=warning
# -------------------------------------------------------------------
# Testing stage
# -------------------------------------------------------------------
test:
stage: test
allow_failure: true
script:
- apt update -y && apt upgrade -y
- pip install --upgrade pip --quiet
- pip install ".[dev, eval]" --quiet
- pytest test