-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
171 lines (150 loc) · 4.25 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
#
# SPDX-License-Identifier: GPL-3.0-or-later
default:
image: "archlinux:latest"
interruptible: true
artifacts:
expire_in: 2 weeks
stages:
- check
- test
- build
- publish
- pages
variables:
BUILD_PUBLISH_PACKAGES: python-pdm python-tox
SYSTEM_PACKAGES: pyalpm python-aiofiles python-email-validator python-jinja python-magic python-orjson python-pydantic python-pyxdg python-pyzstd python-subprocess-tee python-tomli
SYSTEM_INSTALL_PACKAGES: just python-build python-installer python-pdm python-setuptools python-sphinx python-sphinx-argparse python-sphinx_rtd_theme python-sphinxcontrib-programoutput python-wheel
SYSTEM_TEST_PACKAGES: python-coverage python-pytest python-pytest-asyncio python-pytest-lazy-fixture
TEST_PACKAGES: base-devel python-pdm python-tox
.check:
stage: check
before_script:
- |
read -r -a deps <<< "${TEST_PACKAGES}"
pacman --noconfirm -Syu --needed "${deps[@]}"
linter:
extends: .check
script:
- tox -e linter
.bump_dependencies_to_latest: &bump_dependencies_to_latest
- |
if [[ $TEST_LATEST = true ]]; then
pdm update --unconstrained
fi
.test:
stage: test
before_script:
- |
read -r -a deps <<< "${TEST_PACKAGES}"
pacman --noconfirm -Syu --needed "${deps[@]}"
- *bump_dependencies_to_latest
coverage:
extends: .test
script:
- tox -e coverage-linux
coverage: '/TOTAL.*\s([.\d]+)%/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: .tox/coverage.xml
junit: junit-report.xml
.integration_test:
stage: test
before_script:
- printf "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf
- pacman --noconfirm -Fy
- |
read -r -a test_deps <<< "${TEST_PACKAGES}"
pacman --noconfirm -Syu --needed "${test_deps[@]}"
- *bump_dependencies_to_latest
integration:
extends: .integration_test
script:
- tox -e integration
.system_test:
stage: test
before_script:
- |
read -r -a system_deps <<< "${SYSTEM_PACKAGES}"
read -r -a test_deps <<< "${SYSTEM_TEST_PACKAGES}"
pacman --noconfirm -Syu --needed "${system_deps[@]}" "${test_deps[@]}"
system_coverage:
extends: .system_test
script:
- pytest -vv tests/ -m 'not integration and not regex'
.system_integration_test:
stage: test
before_script:
- printf "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf
- pacman --noconfirm -Fy
- |
read -r -a install_deps <<< "${SYSTEM_INSTALL_PACKAGES}"
read -r -a system_deps <<< "${SYSTEM_PACKAGES}"
read -r -a test_deps <<< "${SYSTEM_TEST_PACKAGES}"
pacman --noconfirm -Syu --needed "${install_deps[@]}" "${system_deps[@]}" "${test_deps[@]}"
- just build
- just install
system_integration:
extends: .system_integration_test
script:
- pytest -vv tests/ -m 'integration'
system_integration_core:
extends: .system_integration_test
cache:
paths:
- core/
script:
- pacman --noconfirm -Syu --needed rsync
- rsync --archive --copy-links --delete --human-readable --verbose --timeout=600 --contimeout=60 rsync://geo.mirror.pkgbuild.com/packages/core .
- find "${PWD}/core/os/x86_64/" -type f -name '*.pkg.tar.*' -not -name '*.sig' | xargs --max-args 1 --verbose repod-file package inspect >/dev/null
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $TEST_CORE
.build:
stage: build
before_script:
- |
read -r -a deps <<< "${BUILD_PUBLISH_PACKAGES}"
pacman --noconfirm -Syu --needed "${deps[@]}"
build:
extends: .build
script:
- pdm build
docs:
extends: .build
script:
- tox -e docs
after_script:
- mv docs/_build/html public
artifacts:
paths:
- public
pages:
stage: pages
script:
- "true"
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
regex:
extends: .test
script:
- tox -e regex
pypi_publish:
before_script:
- |
read -r -a deps <<< "${BUILD_PUBLISH_PACKAGES}"
pacman --noconfirm -Syu --needed "${deps[@]}"
rules:
- if: '$PDM_PUBLISH_PASSWORD && $CI_COMMIT_TAG && $CI_PROJECT_PATH == "archlinux/repod"'
script:
- pdm publish --build
stage: publish
tags:
- secure
variables:
PDM_PUBLISH_USERNAME: __token__