/
.gitlab-ci.yml
119 lines (110 loc) · 4.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
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
# running tests twice, so if something breaks when optional dependencies are
# missing, it still shows up. (full coverage would mean running each
# combination, but let's not blow the test matrix out of proportion).
# --skip-env is often used to mask out Python versions that are installed on
# the system but are not what we want to test here (for example, the Pythoh
# 3.13-rc image is based on a Debian that ships its own older Python).
test:tox-bookworm:
image: debian:bookworm
resource_group: uses-coap-ports
script:
- rm -f .coverage* collected-coverage
- apt-get update
- apt-get -y install tox build-essential python3.11-dev libssl-dev autoconf python3-setuptools python3-pip iproute2 libffi-dev libgirepository1.0-dev libcairo2-dev
# Separate run so I don't waste time telling errors in setup apart from errors at runtime
- tox --notest
- "AIOCOAP_TEST_MCIF=\"$(ip -j -6 route list default | python3 -c 'import sys, json; print(json.load(sys.stdin)[0][\"dev\"])')\" tox"
- mkdir collected-coverage/tox-bookworm/ -p
- mv .coverage* collected-coverage/tox-bookworm/
artifacts:
paths:
- collected-coverage/tox-bookworm/
test:pypy:
image: docker.io/pypy:3
resource_group: uses-coap-ports
script:
- rm -f .coverage* collected-coverage
- apt-get update
- apt-get -y install build-essential libssl-dev autoconf iproute2 libffi-dev
- pip install tox
- tox --notest --skip-env '^py[^p]'
- "AIOCOAP_TEST_MCIF=\"$(ip -j -6 route list default | python3 -c 'import sys, json; print(json.load(sys.stdin)[0][\"dev\"])')\" tox --skip-env '^py[^p]'"
# Not generating any coverage: This would slow things down to the point
# where slow_callback_duration from -Xdev bites, and is thus not enabled
# for pypy in tox. It's not like pypy should contribute to coverage anyway.
test:3.12:
image: docker.io/python:3.12
resource_group: uses-coap-ports
script:
- apt-get update
# cmake, libgirepository1.0-dev: required for building pygobject
- apt-get -y install iproute2 cmake libgirepository1.0-dev
- rm -f .coverage* collected-coverage
- pip install tox
# Separate run so I don't waste time telling errors in setup apart from errors at runtime
- tox --notest --skip-env '^py31[^2]'
- "AIOCOAP_TEST_MCIF=\"$(ip -j -6 route list default | python3 -c 'import sys, json; print(json.load(sys.stdin)[0][\"dev\"])')\" tox --skip-env '^py31[^2]'"
- mkdir collected-coverage/tox-3.12/ -p
- mv .coverage* collected-coverage/tox-3.12/
artifacts:
paths:
- collected-coverage/tox-3.12/
test:3.13:
image: docker.io/python:3.13-rc
resource_group: uses-coap-ports
variables:
# Possibly necessary because the image uses some Debian as a base might have another Python installed
TOXENV: "py313-noextras,py313-allextras"
script:
- apt-get update
- apt-get -y install iproute2
# The image's Debian has Rust 1.63, which is too old for the `half` module
# required by cbor-diag (and maturin does not build wheels for 3.13 yet)
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
- source ~/.cargo/env
- rm -f .coverage* collected-coverage
- pip install tox
# Workaround for https://github.com/python-cffi/cffi/issues/71
- tox -e py313-allextras exec --skip-pkg-install -- pip install git+https://github.com/python-cffi/cffi/
# Separate run so I don't waste time telling errors in setup apart from errors at runtime
- tox --notest --skip-env '^py31[^3]'
- "AIOCOAP_TEST_MCIF=\"$(ip -j -6 route list default | python3 -c 'import sys, json; print(json.load(sys.stdin)[0][\"dev\"])')\" tox --skip-env '^py31[^3]'"
- mkdir collected-coverage/tox-3.13/ -p
- mv .coverage* collected-coverage/tox-3.13/
artifacts:
paths:
- collected-coverage/tox-3.13/
test:mypy:
image: docker.io/python:3.12
script:
- pip install mypy
- pip install '.[all]'
- mypy --install-types --non-interactive aiocoap
test:flake:
image: python:3
script:
- pip install flake8
- flake8 .
reuse:
image: python:3
script:
- pip install reuse
- reuse lint
pages:
image: docker.io/python:3
stage: deploy
dependencies:
- test:tox-bookworm
- test:3.12
- test:3.13
script:
- python3 -m pip install coverage
- rm -f .coverage* public
- mv collected-coverage/*/.coverage* .
- python3 -m coverage combine
- python3 -m coverage report --include=aiocoap/\*
- python3 -m coverage html --include=aiocoap/\*
- mv htmlcov public
artifacts:
paths:
- public