ci: Add xtask infra + reverse dependency testing#435
Merged
cgwalters merged 1 commit intoalexcrichton:mainfrom Mar 3, 2026
Merged
ci: Add xtask infra + reverse dependency testing#435cgwalters merged 1 commit intoalexcrichton:mainfrom
cgwalters merged 1 commit intoalexcrichton:mainfrom
Conversation
3b2354c to
6d84c8d
Compare
xzfc
approved these changes
Mar 3, 2026
Comment on lines
+16
to
+18
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: xtask |
Collaborator
There was a problem hiding this comment.
Nit: it seems that the cache works for xtask itself, but not for cloned revdeps.
I've retriggered CI to check this:
- First run (not cached): https://github.com/alexcrichton/tar-rs/actions/runs/22599984019/job/65479363534?pr=435 - builds both
xtaskand revdeps. - Second run (cached): https://github.com/alexcrichton/tar-rs/actions/runs/22599984019/job/65595504226?pr=435 - builds revdeps only.
Perhaps a shared CARGO_TARGET_DIR/--target-dir/build.target-dir can make it work.
Tho maybe saving 6 minutes on CI don't worth it.
Collaborator
Author
There was a problem hiding this comment.
I tried this, but it broke the cargo-vendor-filterer tests for obscure reasons (it expects target/ in a different place).
I don't think we'll have a volume of PRs where the caching matters.
(Of course this topic of CI efficiency does relate to the fact that right now CI here just uses the $0 GHA budget allocated to alex's personal projects...)
The [xtask pattern](https://github.com/matklad/cargo-xtask) is a good way to capture ad-hoc workflows that one might otherwise write in a poor language like bash. Add the infra for that, and then add a `revdep-test` verb which also gets wired up to CI. This clones a few (ad-hoc selected) projects which use this crate. Then we patch their Cargo.toml to use our local checkout and run their test suite. Revdeps are pinned to release tags where possible (cargo 0.94.0, cargo-vendor-filterer v0.5.18) for easy auditing; crates.io retains a commit hash since it has no tags. The cargo test filter `package::` is a substring match so we skip unrelated cargo snapshot tests (cargo_add, cargo_info, etc.) that would otherwise fail due to Rust version differences. The goal is just more testing; prep for more work on this crate. Assisted-by: OpenCode (Claude Opus) Signed-off-by: Colin Walters <walters@verbum.org>
6d84c8d to
16c64f3
Compare
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.
Previously we added semver checks which is
great, but this will (hopefully) catch non-API breakages that we may have missed in unit tests.
The xtask pattern is a good way to capture ad-hoc workflows that one might otherwise write in a poor language like bash.
Add the infra for that, and then add a
revdep-testverb which also gets wired up to CI.This clones a few (ad-hoc selected) projects which use this crate. Then we patch their Cargo.toml to use our local checkout and run their test suite.
The goal is just more testing; prep for more work on this crate.
Assisted-by: OpenCode (Claude Opus)