Skip to content

Continuous integration and releases

What the workflows do

  • .github/workflows/ci.yml (every push to main and every pull request):
  • Rust: cargo fmt --check, cargo clippy with and without the python feature (warnings are errors, except needless_range_loop), cargo test --release on Linux, macOS and Windows, and the exhaustive 3D tests on Linux;
  • Python 3.11 and 3.14 on Linux, macOS arm64, macOS x86_64 and Windows: build, test suite, doctests (the pink26 oracle tests are skipped);
  • lint: ruff and mypy --strict on the Python sources; msrv: the crate checked with Rust 1.88, the rust-version of Cargo.toml;
  • oracle: pink26 is built from alainlebret/pink26, then the whole suite runs, the point-by-point comparisons included, on Linux and macOS. It is the only place where the Linux (glibc) parsing rules of digitopo.io are compared with pink26.
  • fuzz: on Linux with the nightly toolchain, each cargo-fuzz target of fuzz/ (read_pink, write_read_pink, binary_operators, grey_operators, see fuzz/README.md) runs for 60 s; the crash inputs are uploaded as an artifact of the run when a target fails.
  • verify: on Linux, cargo fmt --check, cargo clippy and cargo test --release in verify/ (see verify/README.md), which compares digitopo's topology primitives with Pink's C functions from pink26 (mctopo.c, mctopo3d.c) on all 2^26 configurations in 3D, all 2^8 in 2D, and grey-level neighbourhoods (about a minute).
  • .github/workflows/wheels.yml (a tag v*, or by hand from the Actions tab):
  • one abi3 wheel per platform (any Python >= 3.11): manylinux and musllinux on x86_64 and aarch64, macOS x86_64 and arm64, Windows x64, and the source distribution;
  • each wheel is installed (never built from source) and tested on its platform with Python 3.11 and 3.14 (the musllinux wheels by a smoke test in an Alpine container);
  • by hand, with the testpypi input, everything is published to TestPyPI (a rehearsal); on a tag v*, after checking that the tag matches the version of Cargo.toml, to PyPI.

To switch them on

  1. Create the GitHub repository alainlebret/digitopo and push main.
  2. The oracle and verify jobs of the CI check out alainlebret/pink26, which is public: no token is needed. Should it become private, store a fine-grained token with read access to its contents as the repository secret PINK26_TOKEN (Settings, Secrets and variables, Actions): the jobs use it when it exists.
  3. GitHub Pages: Settings, Pages, Source: "GitHub Actions". The Docs workflow then publishes the site at https://alainlebret.github.io/digitopo/ on every push to main.
  4. Trusted publishing (no password stored on GitHub), on both indexes:
  5. on https://test.pypi.org, add a pending publisher for the project digitopo, with the repository alainlebret/digitopo, the workflow wheels.yml and the environment testpypi;
  6. on https://pypi.org, the same with the environment pypi;
  7. on GitHub, create the environments testpypi and pypi (Settings, Environments), pypi ideally with a required reviewer.
  8. The runner labels (macos-15 for arm64, macos-15-intel for x86_64, ubuntu-24.04-arm) follow GitHub's offer at the end of 2026. macos-15-intel is GitHub's last Intel image, supported until 2027: after that, the x86_64 macOS wheel must be cross-compiled on arm64 (maturin --target x86_64-apple-darwin) or dropped.

To release a version

  1. Update version in Cargo.toml (the Python package takes its version from it) and run cargo check to update Cargo.lock. In CHANGELOG.md, rename ## [Unreleased] to ## [x.y.z] - YYYY-MM-DD and open a new empty ## [Unreleased] above it. Commit and push main; wait for the CI and Docs workflows to pass.
  2. Rehearsal: in the Actions tab, run the Wheels workflow by hand on main with "Publish the wheels and the source distribution to TestPyPI" ticked. Every wheel is built and tested (the musllinux wheels by a smoke test on Alpine), then published to TestPyPI. Check it in a fresh environment: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ digitopo. A version can be uploaded only once to an index: to rehearse again, bump the version (for example 0.1.0rc1, then 0.1.0rc2) or delete the release on TestPyPI.
  3. Tag and push: git tag v0.1.0 && git push origin v0.1.0. The Wheels workflow checks that the tag is v followed by the version of Cargo.toml, builds and tests every wheel, then publishes to PyPI after the approval of the pypi environment. A version published on PyPI can never be uploaded again, even after a deletion.
  4. Check the result with pip install digitopo in a fresh environment.

Locally

cargo test --release                       # Rust tests
cargo test --release --lib -- --ignored    # exhaustive 3D tests (a few seconds)
pip install -e ".[test]" && pytest         # Python tests (with pink26 installed: the oracle too)
maturin build --release && maturin sdist   # a wheel for this machine and the source distribution