# 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-minimal] environment: FORCE_COLOR: "1" commands: - apt-get update - apt-get -y install build-essential python3.11-dev libssl-dev autoconf python3-pip python3-venv iproute2 libffi-dev libgirepository1.0-dev libcairo2-dev # "Externally managed", so we have to go through a venv - python3 -m venv .venv - . .venv/bin/activate # Both are available, but are quite old and woudl not forward # __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI (tox since 4.30.0) or would fail # to build (setuptools). - pip install tox setuptools # 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" test:pypy: image: docker.io/pypy:3 depends_on: [test:3.13-minimal] 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 - 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]'" test:py312: image: docker.io/python:3.12 depends_on: [test:3.13-minimal] 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]'" test:3.13-minimal: image: docker.io/python:3.13 depends_on: [] environment: # This is the fastest we can run at all, and serves as our "hero test" TOXENV: "py313-noextras" FORCE_COLOR: "1" commands: - pip install tox - tox --notest --skip-env '^py31[^3]' - tox --skip-env '^py31[^3]' test:3.13: image: docker.io/python:3.13 depends_on: [test:3.13-minimal] environment: # Possibly necessary because the image uses some Debian as a base might have another Python installed TOXENV: "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]'" test:3.14: image: docker.io/python:3.14 depends_on: [test:3.13-minimal] environment: # Possibly necessary because the image uses some Debian as a base might have another Python installed TOXENV: "py314-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[^4]' - "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]'" 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 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 aiocoap 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 # codeberg pages redirects from ./index.html to ./ and drops query # paramters. That's not wrong (wouldn't even blame them for not serving # with unknown params), but mismatches what Jupyter is expecting. - "find public/doc -name '*.html' -exec sed 's@lite/lab/index.html.path=@lite/lab/?path=@' -i '{}' '+'" 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-minimal - test:3.13 - test:3.14 - test:pypy - doc - build-wheel environment: FORCE_COLOR: "1" commands: - python3 -m pip install coverage genbadge[all] - ./.woodpecker/build-pages.sh 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