-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy path.woodpecker.yml
182 lines (165 loc) · 6.41 KB
/
.woodpecker.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
172
173
174
175
176
177
178
179
180
181
182
# SPDX-FileCopyrightText: Christian Amsüss
# SPDX-License-Identifier: MIT
when:
- event: push
# While we're still on the GitHub issue tracker, the pull_request event stays off, and we evaluate every single branch.
# branch: [main, woodpecker]
# - event: pull_request
# 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 Python
# 3.13 image is based on a Debian that ships its own older Python).
# Generally, all can run in parallel; setting depends_on to one hero test so
# that we don't waste resources if one already fails.
steps:
test:tox-bookworm:
image: debian:bookworm
depends_on: [test:3.13]
environment:
FORCE_COLOR: "1"
commands:
- 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/
test:pypy:
image: docker.io/pypy:3
depends_on: [test:3.13]
environment:
FORCE_COLOR: "1"
commands:
- apt-get update
- apt-get -y install build-essential libssl-dev autoconf iproute2 libffi-dev
# lakers-python is not yet built for pypy; tracked at <https://github.com/openwsn-berkeley/lakers/issues/288>
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
- . ~/.cargo/env
- 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]'"
- mkdir collected-coverage/pypy/ -p
- mv .coverage* collected-coverage/pypy/
test:py312:
image: docker.io/python:3.12
depends_on: [test:3.13]
environment:
FORCE_COLOR: "1"
commands:
- apt-get update
# cmake, libgirepository1.0-dev: required for building pygobject
- apt-get -y install iproute2 cmake libgirepository1.0-dev
- 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/
test:3.13:
image: docker.io/python:3.13
depends_on: []
environment:
# Possibly necessary because the image uses some Debian as a base might have another Python installed
TOXENV: "py313-noextras,py313-allextras"
FORCE_COLOR: "1"
commands:
- apt-get update
- apt-get -y install iproute2
- 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[^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/
mypy:
image: docker.io/python:3.12
depends_on: []
environment:
FORCE_COLOR: "1"
commands:
- pip install mypy
- pip install '.[all]'
- mypy --install-types --non-interactive src/aiocoap
ruff:
image: python:3
depends_on: []
environment:
FORCE_COLOR: "1"
commands:
- pip install ruff
- ruff format --check
# Excluding the client scripts as their heavy reliance on `from aiocoap
# import *` would decrease their usefullness as easy quick-start script
- ruff check src
reuse:
image: python:3
depends_on: []
environment:
FORCE_COLOR: "1"
commands:
- pip install reuse
- reuse lint
doc:
image: python:3.13
depends_on: []
environment:
FORCE_COLOR: "1"
commands:
# synced with .readthedocs.yaml and pyproject.toml
- pip install '.[docs,oscore,prettyprint]'
- python3 -m sphinx doc public/doc/
- python3 -m docutils README.rst --strict > /dev/null
build-wheel:
image: python:3.13
depends_on: []
environment:
FORCE_COLOR: "1"
commands:
- pip install build
- python3 -m build
- mkdir -p public
- cp -r dist/ public/
build-pages:
image: docker.io/python:3
depends_on:
- test:tox-bookworm
- test:py312
- test:3.13
- test:pypy
- doc
- build-wheel
environment:
FORCE_COLOR: "1"
commands:
- python3 -m pip install coverage
- mv collected-coverage/*/.coverage* .
- python3 -m coverage combine
- python3 -m coverage report
- python3 -m coverage html
- mkdir -p public
- mv htmlcov public/coverage/
# Link for the wheel goes to the `raw.` URI because that allows CORS,
# making it useful as a pyodide source.
- echo '<title>aiocoap build artifacts</title>' > public/index.html
- echo '<h1>aiocoap build artifacts</h1><ul>' >> public/index.html
- echo '<li><a href="coverage/">Coverage report</a>' >> public/index.html
- echo '<li><a href="doc/">Documentation</a>' >> public/index.html
- echo '<li><a href="https://raw.codeberg.page/aiocoap/aiocoap/@pages/'$(echo dist/*.whl)'">Current wheel</a>' >> public/index.html
- echo '</ul><footer>Current version described as '$(git describe --always) >> public/index.html
- cat public/index.html
publish-pages:
image: codeberg.org/xfix/plugin-codeberg-pages-deploy:1
depends_on:
- build-pages
settings:
folder: public
ssh_key:
from_secret: ssh_key
when:
- event: push
# add your branch name here temporarily if you want to see the output
# deployed even before it hits main
branch: main