Repository navigation
ci: consolidate and speed up CI - #564
Merged
Merged
Conversation
This was referenced Oct 16, 2026
Rust 1.99.0 miscompiled C `bool` returns from the FFI library; 1.99.1 carries the fix. A root toolchain file makes the test, FFI and release jobs build with the same compiler as each other and as local builds. mise pins the dev tooling CI installs, so local runs can use the same versions. It reads Rust itself from rust-toolchain.toml, so the version lives in one file. The nextest `ci` profile reports every failure and kills hung tests. Assisted-by: Claude Code:claude-opus-5-5
…ents reqwest is built with `rustls-no-provider`, so building a client panics unless a rustls crypto provider has been installed for the process. Library entry points install the ring provider before building their own clients. Several tests build their own client to call a mock server or to feed a request into the code under test. Those tests passed only when an earlier test in the same binary had already installed the provider. Under nextest, which runs each test in its own process, and under `cargo test <filter>`, those tests panic with "No rustls crypto provider is configured". A small helper in each test module now installs the provider before building the client. Assisted-by: Claude Code:claude-opus-5-5
The CMake project refused to configure unless `cargo +nightly` existed, and FindCargo reported nightly's version even though the library builds with whichever toolchain `cargo` resolves to. With `rust-toolchain.toml` pinning stable, FindCargo now reports the cargo that actually builds the library, and the nightly gate is gone. Header generation still needs nightly. cbindgen's macro expansion passes `-Zunpretty=expanded`, which stable rejects, so the `rustup run nightly` call sites stay. Assisted-by: Claude Code:claude-opus-5-5
The examples under rust/pact_ffi/examples had no CI coverage. .github/scripts/ffi-examples.sh builds pact_ffi once in release, the profile that ships, and installs it under rust/pact_ffi/build/install. Each example then runs against that install, and the C projects under c/ reuse the same install. The script replaces rust/pact_ffi/ci-build.sh. Only CI runs it, so it sits with the workflows, not in the crate. Assisted-by: Claude Code:claude-opus-5-5
Corrosion builds pact_ffi in release inside each project's own build directory, so CI compiled the library twice per OS. With the variable set, both projects link the install produced by rust/pact_ffi/ci-build.sh and copy the library beside the executable, where the run recipe expects it. Without it, local builds keep using Corrosion. The new root rust-toolchain.toml pins stable, which would otherwise apply to the local Corrosion build. Corrosion runs cbindgen with no toolchain override, and cbindgen's macro expansion needs nightly. The justfiles therefore default RUSTUP_TOOLCHAIN to nightly, as the READMEs already required; a caller's own RUSTUP_TOOLCHAIN still wins. Assisted-by: Claude Code:claude-opus-5-5
Build, FFI and compatibility runs move into test.yml, gated by a single `CI complete` check: - Pull requests run once per commit, on Linux, macOS and Windows. - Draft PRs run nothing heavy until marked ready. - Caches save only from master, so PR runs restore master's entries without filling the repository's 10 GB budget. - nextest runs the suite, with doctests run separately. - The V2 matching engine and the ignored mock-server-log test reuse the same build. - Compatibility v1-v4 share one compile per OS. - pact_ffi builds once per OS, in release with the pinned toolchain, for every C example. Nightly is installed only for cbindgen. - Windows legs build on a Dev Drive. - A per-feature check replaces the single --no-default-features check. It skips pact_matching with `plugins` alone, which pact-plugin-driver currently breaks by using chrono's clock without enabling it. Assisted-by: Claude Code:claude-opus-5-5
The issue title was interpolated straight into a `run:` script. The job runs for anyone who comments `/jira ticket`, so anyone could open an issue with a crafted title and execute commands on the runner, which holds the Jira credentials. The title and the comment body now reach the shell through environment variables. Assisted-by: Claude Code:claude-opus-5-5
test.yml replaces the build, FFI and compatibility workflows. The release build no longer runs on pull requests. Release PRs will trigger it once the release process moves to PRs. The remaining workflows pin actions by commit SHA and declare the token permissions they use. Assisted-by: Claude Code:claude-opus-5-5
The README badge points at test.yml, and the AppVeyor badge for a service the repository no longer uses is gone. CLAUDE.md and the Copilot instructions describe the pinned toolchain, the mise-managed tools, nextest, and what test.yml covers. Assisted-by: Claude Code:claude-opus-5-5
The release workflow named its own compiler, so it could drift from the pin in rust-toolchain.toml. dtolnay/rust-toolchain also adds the matrix `targets` only to the toolchain named in the action. The aarch64-pc-windows-msvc leg cross-compiles on an x64 runner, so a mismatch would leave the toolchain that builds without its standard library. actions-rust-lang/setup-rust-toolchain, given no `toolchain`, installs the one rust-toolchain.toml names and adds `target` to it. The pin now lives in one file. The action's caching stays off because the workflow already runs Swatinem/rust-cache. The pact_ffi README's "Release compiler" section went with the separate pin. Its Dependencies section already says the library builds with the pinned toolchain. Assisted-by: Claude Code:claude-opus-5-5
The steps after nextest now run even when nextest fails. The compatibility suite, the musl job and the doctests pass `--no-fail-fast`, so one failing test binary no longer hides the results of later ones. @actions/cache passes GNU tar options such as `--posix`, which Alpine's busybox tar rejects. rust-cache reports the failure as a warning, so the musl job always built cold. The job now installs GNU tar. Assisted-by: Claude Code:claude-opus-5-5
JP-Ellis
marked this pull request as ready for review
October 16, 2026 23:03
mise pinned cargo-binstall, but the FFI job never installed it, so the `cargo:` backend fell back to compiling cbindgen from source on every cold run. The job now installs cargo-binstall alongside cbindgen. mise.toml enables cargo-quickinstall as a binary source and sets `binstall_only`, so a missing prebuilt binary fails the install instead of silently compiling. Assisted-by: Claude Code:claude-opus-5-5
…toolchain Without PACT_FFI_PREBUILT_DIR, the C projects build pact_ffi through Corrosion. Corrosion's cbindgen helper runs cbindgen with whatever toolchain the environment selects, and cbindgen's macro expansion needs nightly. The justfiles worked around this by defaulting RUSTUP_TOOLCHAIN to nightly. Corrosion then built the whole library on nightly too, unlike every other build in the repository. mise now exports RUSTUP_TOOLCHAIN from rust-toolchain.toml, so the justfile default no longer applied inside a mise environment, and the header step would have run on the pinned toolchain and failed. Each CMakeLists.txt now generates the header with its own `rustup run nightly cbindgen` command, the same way rust/pact_ffi's CMake project does. Corrosion builds the library with whichever toolchain rust-toolchain.toml selects. The justfiles no longer set RUSTUP_TOOLCHAIN. Assisted-by: Claude Code:claude-opus-5-5
pact-plugin-driver called `Utc::now()` without enabling chrono's `clock` feature, so pact_matching failed to build with `plugins` as its only feature. The features job skipped that combination. pact-plugins 801c1433 enables `clock`, and the lock now resolves the driver to 7a290b6b, which carries that fix and moves to zip 9. Every zip 8 release is yanked. The features job now runs one `cargo hack check --each-feature` over the whole workspace. Assisted-by: Claude Code:claude-opus-5-5
pact_verifier's unit tests start mock servers that merge their interactions into shared pact files, such as RustPactVerifier-PactBrokerStub.json. `write_pact` serialises writers with an in-process mutex only. Its new-file branch also truncates the file before taking the file lock. `cargo test` runs these tests as threads of one process, so the mutex was enough. nextest runs each test in its own process, and on macOS CI eleven pact_broker tests failed with "Failed to parse Pact JSON" after reading a file another process had just truncated. A nextest test group with one thread covers the `tests` and `pact_broker::tests` modules of the pact_verifier library. That is about 150 tests, and serialised they still take about 15 s. The race in `write_pact` itself is left for a library change. Assisted-by: Claude Code:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Make CI fast, cache-efficient and deterministic. This PR changes no library behaviour, and adds no lint or formatting gates.
Baseline
A recent master run had these problems:
build.ymlran on bothpush: '**'andpull_request, so every PR commit built twice.release.ymlbuilt all 8 release targets for each PR commit.pact_ffiin release once per C project, so each OS built it twice.stable, FFI usednightly, and the release workflow pinned1.98.1. The C examples tested a library built by a different compiler from the one that ships.checkout@v2tov5,install-action@mainandgithub-script@v5were in use.pact_ffi/examplesnever ran.--no-default-features.What changes
One
test.ymlreplacesbuild.yml,build-ffi.ymlandcompatability-suite.yml. A singleCI completesentinel needs every job.masterand on PRs tomaster, so each PR commit gets one run. Draft PRs skip every heavy job, and marking a PR ready starts the full run.rust-toolchain.tomlpins 1.99.1, which carries the fix for 1.99.0's Cboolreturn miscompilation. Tests, FFI builds and releases all read it. Nightly is installed only for cbindgen.rust-toolchain.toml.jdx/mise-actioninstalls only what each job needs.master. PR runs restoremaster's entries and write nothing.pact_ffibuilds once per OS, in release, with the pinned toolchain.pact_ffi/examplesand bothc/projects run against that one build.master.cargo hack check --workspace --each-featurereplaces the single--no-default-featurescheck.release.ymlno longer runs on pull requests. PR 2 replaces it. Until then it takes its toolchain fromrust-toolchain.toml.Commit sequence
chore: pin Rust 1.99.1 and declare CI tools in mise: the toolchain file,mise.tomland the nextestciprofile. mise reads Rust from the toolchain file, so the version lives in one place.test: install the rustls crypto provider in tests that build HTTP clients:build(ffi): build with the pinned toolchain, keep nightly for cbindgen:-Zunpretty=expanded.test(ffi): build and run the C examples against one release build:.github/scripts/ffi-examples.shreplacesrust/pact_ffi/ci-build.sh. It installs one release build underrust/pact_ffi/build/installand runs every example against it. Only CI runs it, so it sits with the workflows.build(c): accept a prebuilt pact_ffi through PACT_FFI_PREBUILT_DIR:c/projects link the install from step 4.RUSTUP_TOOLCHAINto nightly, which the READMEs already required. Step 13 removes that default.ci: consolidate testing into one draft-aware workflow: addstest.yml.fix(ci): keep issue text out of shell commands in the Jira workflow:run:script./jira ticket, on a runner that holds the Jira credentials.ci: retire superseded workflows and pin remaining actionsdocs: describe the consolidated CI and nextest workflowci: build releases with the toolchain from rust-toolchain.toml:dtolnay/rust-toolchainnamed its own compiler, and added the matrixtargetsonly to that one. The toolchain file overrode it, so the aarch64 Windows cross-compile could build without its standard library.setup-rust-toolchain, given notoolchain, installs the pinned one and addstargetto it.ci: report every failure and cache the musl job:--no-fail-fastkeeps one failing binary from hiding the rest.ci: install cbindgen from prebuilt binaries only:cargo:backend downloads cbindgen in seconds and doesn't compile it.mise.tomlenables cargo-quickinstall andbinstall_only, so a missing binary fails loudly.cargo:backend requires mise'srusttool, so the FFI job installs it too. It resolves to the toolchain already installed.build(c): generate pact.h on nightly, build pact_ffi with the pinned toolchain:RUSTUP_TOOLCHAIN, so the justfiles' nightly default stopped applying, and Corrosion's cbindgen step would have run on 1.99.1 and failed.CMakeLists.txtnow runsrustup run nightly cbindgenfor the header, asrust/pact_ffi's CMake project does. Corrosion builds the library with the pinned toolchain.build: update pact-plugin-driver and check `plugins` alone again:clockfeature, sopact_matchingbuilds withpluginsalone.pluginsexclusion.test: run pact_verifier's pact-writing tests one at a time under nextest:write_pactlocks only within a process, and its new-file branch truncates before taking the file lock.pact_brokertests failed on macOS after reading a file another process had just truncated.write_pactis a library change, left for its own PR.Alternatives weighed
c/projects. Corrosion always passes its own--target-dir, so the projects import the prebuilt library instead.RUSTC_BOOTSTRAP=1. Nightly stays, installed with--profile minimal, for header generation only.rustentry inmise.toml. It would repeat the version inrust-toolchain.toml. mise'sidiomatic_version_file_enable_toolsreads the toolchain file instead.build-warnings: allow.warnkeeps today's behaviour, where warnings print and don't fail.setup-rust-toolchaindefaults todeny.setup-conan's package cache. It saved on every run, which took 571 s on Windows. Explicit restore and save onmasterreplace it.Gaps recorded, not filled
write_pactcan let one process read a file another has just truncated. Commit 15 works around it for pact_verifier's tests only.rust-version, and adding one changes what users' resolvers see.Maintainer action after merge
CI completein place of the old job names.