Debian Codegraph @

.woodpecker/all.yaml

raw
1 # SPDX-FileCopyrightText: Christian Amsüss
2 # SPDX-License-Identifier: MIT
3
4 when:
5 - event: push
6 # While we're still on the GitHub issue tracker, the pull_request event stays off, and we evaluate every single branch.
7 # branch: [main, woodpecker]
8 # - event: pull_request
9
10
11 # running tests twice, so if something breaks when optional dependencies are
12 # missing, it still shows up. (full coverage would mean running each
13 # combination, but let's not blow the test matrix out of proportion).
14
15 # --skip-env is often used to mask out Python versions that are installed on
16 # the system but are not what we want to test here (for example, the Python
17 # 3.13 image is based on a Debian that ships its own older Python).
18
19 # Generally, all can run in parallel; setting depends_on to one hero test so
20 # that we don't waste resources if one already fails.
21
22 steps:
23 test:tox-bookworm:
24 image: debian:bookworm
25 depends_on: [test:3.13-minimal]
26 environment:
27 FORCE_COLOR: "1"
28 commands:
29 - apt-get update
30 - apt-get -y install build-essential python3.11-dev libssl-dev autoconf python3-pip python3-venv iproute2 libffi-dev libgirepository1.0-dev libcairo2-dev
31 # "Externally managed", so we have to go through a venv
32 - python3 -m venv .venv
33 - . .venv/bin/activate
34 # Both are available, but are quite old and woudl not forward
35 # __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI (tox since 4.30.0) or would fail
36 # to build (setuptools).
37 - pip install tox setuptools
38 # Separate run so I don't waste time telling errors in setup apart from errors at runtime
39 - tox --notest
40 - "AIOCOAP_TEST_MCIF=\"$(ip -j -6 route list default | python3 -c 'import sys, json; print(json.load(sys.stdin)[0][\"dev\"])')\" tox"
41
42 test:pypy:
43 image: docker.io/pypy:3
44 depends_on: [test:3.13-minimal]
45 environment:
46 FORCE_COLOR: "1"
47 commands:
48 - apt-get update
49 - apt-get -y install build-essential libssl-dev autoconf iproute2 libffi-dev
50 # lakers-python is not yet built for pypy; tracked at <https://github.com/openwsn-berkeley/lakers/issues/288>
51 - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
52 - . ~/.cargo/env
53 - pip install tox
54 - tox --notest --skip-env '^py[^p]'
55 - "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]'"
56
57 test:py312:
58 image: docker.io/python:3.12
59 depends_on: [test:3.13-minimal]
60 environment:
61 FORCE_COLOR: "1"
62 commands:
63 - apt-get update
64 # cmake, libgirepository1.0-dev: required for building pygobject
65 - apt-get -y install iproute2 cmake libgirepository1.0-dev
66 - pip install tox
67 # Separate run so I don't waste time telling errors in setup apart from errors at runtime
68 - tox --notest --skip-env '^py31[^2]'
69 - "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]'"
70
71
72 test:3.13-minimal:
73 image: docker.io/python:3.13
74 depends_on: []
75 environment:
76 # This is the fastest we can run at all, and serves as our "hero test"
77 TOXENV: "py313-noextras"
78 FORCE_COLOR: "1"
79 commands:
80 - pip install tox
81 - tox --notest --skip-env '^py31[^3]'
82 - tox --skip-env '^py31[^3]'
83
84 test:3.13:
85 image: docker.io/python:3.13
86 depends_on: [test:3.13-minimal]
87 environment:
88 # Possibly necessary because the image uses some Debian as a base might have another Python installed
89 TOXENV: "py313-allextras"
90 FORCE_COLOR: "1"
91 commands:
92 - apt-get update
93 - apt-get -y install iproute2
94 - pip install tox
95 # Separate run so I don't waste time telling errors in setup apart from errors at runtime
96 - tox --notest --skip-env '^py31[^3]'
97 - "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]'"
98
99 test:3.14:
100 image: docker.io/python:3.14
101 depends_on: [test:3.13-minimal]
102 environment:
103 # Possibly necessary because the image uses some Debian as a base might have another Python installed
104 TOXENV: "py314-allextras"
105 FORCE_COLOR: "1"
106 commands:
107 - apt-get update
108 - apt-get -y install iproute2
109 - pip install tox
110 # Separate run so I don't waste time telling errors in setup apart from errors at runtime
111 - tox --notest --skip-env '^py31[^4]'
112 - "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[^4]'"
113
114 mypy:
115 image: docker.io/python:3.12
116 depends_on: []
117 environment:
118 FORCE_COLOR: "1"
119 commands:
120 - pip install mypy
121 - pip install '.[all]'
122 - mypy --install-types --non-interactive aiocoap
123
124 ruff:
125 image: python:3
126 depends_on: []
127 environment:
128 FORCE_COLOR: "1"
129 commands:
130 - pip install ruff
131 - ruff format --check
132 # Excluding the client scripts as their heavy reliance on `from aiocoap
133 # import *` would decrease their usefullness as easy quick-start script
134 - ruff check aiocoap
135
136 reuse:
137 image: python:3
138 depends_on: []
139 environment:
140 FORCE_COLOR: "1"
141 commands:
142 - pip install reuse
143 - reuse lint
144
145 doc:
146 image: python:3.13
147 depends_on: []
148 environment:
149 FORCE_COLOR: "1"
150 commands:
151 # synced with .readthedocs.yaml and pyproject.toml
152 - pip install '.[docs,oscore,prettyprint]'
153 - python3 -m sphinx doc public/doc/
154 - python3 -m docutils README.rst --strict > /dev/null
155 # codeberg pages redirects from ./index.html to ./ and drops query
156 # paramters. That's not wrong (wouldn't even blame them for not serving
157 # with unknown params), but mismatches what Jupyter is expecting.
158 - "find public/doc -name '*.html' -exec sed 's@lite/lab/index.html.path=@lite/lab/?path=@' -i '{}' '+'"
159
160 build-wheel:
161 image: python:3.13
162 depends_on: []
163 environment:
164 FORCE_COLOR: "1"
165 commands:
166 - pip install build
167 - python3 -m build
168 - mkdir -p public
169 - cp -r dist/ public/
170
171 build-pages:
172 image: docker.io/python:3
173 depends_on:
174 - test:tox-bookworm
175 - test:py312
176 - test:3.13-minimal
177 - test:3.13
178 - test:3.14
179 - test:pypy
180 - doc
181 - build-wheel
182 environment:
183 FORCE_COLOR: "1"
184 commands:
185 - python3 -m pip install coverage genbadge[all]
186 - ./.woodpecker/build-pages.sh
187
188 publish-pages:
189 image: codeberg.org/xfix/plugin-codeberg-pages-deploy:1
190 depends_on:
191 - build-pages
192 settings:
193 folder: public
194 ssh_key:
195 from_secret: ssh_key
196 when:
197 - event: push
198 # add your branch name here temporarily if you want to see the output
199 # deployed even before it hits main
200 branch: main