-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy path.gitlab-ci.yml
133 lines (122 loc) · 3.08 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
include:
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6a40df92957c8ce9ee741aaccc5daaaf70545b1e/templates/ci-fairy.yml'
default:
# Protect CI infra from rogue jobs
timeout: 15 minutes
# Allow jobs to be caneled on new commits
interruptible: true
# Retry on infra hickups automatically
retry:
max: 1
when:
- 'api_failure'
- 'runner_system_failure'
- 'scheduler_failure'
- 'stuck_or_timeout_failure'
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# Don't trigger a branch pipeline if there is an open MR
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
variables:
FDO_UPSTREAM_REPO: agx/git-buildpackage
stages:
- check
- package
python-lint:
stage: check
image: debian:sid
before_script:
- apt -y update
- apt -y install ruff
script:
# Ruff is fast, run it twice to have junit and stout:
- ruff check --output-format=junit --output-file=ruff-junit.xml . || true
- ruff check .
artifacts:
paths:
- ruff-junit.xml
reports:
junit: ruff-junit.xml
python-tests:
stage: check
image: debian:sid
variables:
PYTEST_ARGS: --junit-xml=pytest-junit.xml --cov --cov-report term --cov-report xml:coverage.xml
before_script:
# Some tests need sources configured for e.g. "apt showsrc"
- echo "deb-src http://deb.debian.org/debian/ sid main" > /etc/apt/sources.list.d/sid-src.list
- apt -y update
- apt -y install curl python3-requests flake8
- apt -y build-dep .
script:
- git submodule update --init -- tests/component/deb/data/
- python3 setup.py build
- make syntax-check
- GBP_NETWORK_TESTS=1 make test
coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- pytest-junit.xml
reports:
junit: pytest-junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
python-typecheck:
stage: check
image: debian:sid
variables:
MYPY_ARGS: --junit-xml=mypy-junit.xml
before_script:
- apt -y update
- apt -y build-dep .
- apt -y install mypy
script:
- python3 setup.py build
- make type-check
artifacts:
paths:
- mypy-junit.xml
reports:
junit: mypy-junit.xml
shellcheck:
stage: check
image: debian:sid
before_script:
- apt -y update
- apt -y install shellcheck bash zsh make
script:
- make shell-check
codespell:
stage: check
image: debian:sid
before_script:
- apt -y update
- apt -y install codespell
script:
- codespell docs/
# Sanity checks of MR settings and commit logs
sanity:
extends:
- .fdo.ci-fairy
stage: check
variables:
GIT_DEPTH: "100"
needs: []
script: |
ci-fairy check-commits --signed-off-by --junit-xml=commit-message-junit-report.xml
artifacts:
reports:
junit: commit-message-junit-report.xml
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME'
salsaci:
stage: package
trigger:
include: debian/salsa-ci.yml
strategy: depend