Repository navigation
ci: verify the supported Elixir and req ranges with a matrix - #5
Merged
Merged
Conversation
mix.exs declares elixir "~> 1.18" and req "~> 0.5.15 or ~> 0.6", but CI ran a single Nix-pinned toolchain against mix.lock, so neither range was actually exercised. The 1.18 compile error fixed in c9205f9 would not have been caught. Add a compatibility job covering the corners of both ranges: Elixir 1.18.4 (OTP 27 and 28) and 1.20.1, each against req 0.5.15 and 0.6.3. Each row resolves deps without mix.lock and compiles with --warnings-as-errors. Pinning needs pin-req.sh because resolution always selects the newest version a constraint allows and "mix deps.update --to" is a no-op here; the script rewrites the constraint, then asserts the resolved version matches so a silent no-op fails the build instead of quietly retesting the same version in every row.
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.
Why
mix.exsdeclareselixir: "~> 1.18"andreq: "~> 0.5.15 or ~> 0.6", but CI ran a single Nix-pinned Elixir 1.20 againstmix.lock— which pinned req to 0.5.18. Neither range was actually exercised, so the 1.18 compile error fixed in c9205f9 would not have been caught:(Reproduced on c9205f9^ with Elixir 1.18.4 to confirm a matrix would catch it.)
What
A
compatibilityjob covering the corners of both ranges — Elixir 1.18.4 (OTP 27 and 28) and 1.20.1, each against req 0.5.15 and 0.6.3. Every row resolves deps withoutmix.lockand compiles with--warnings-as-errors. The existing Nix job still owns format and Credo.Note on
pin-req.shPinning needs a helper because
mix deps.update --to '0.5.15' reqis a silent no-op here — resolution always selects the newest version a constraint allows. Without the helper, every matrix row would test req 0.6.3 while displaying0.5.15in its name: a green matrix proving nothing.pin-req.shrewrites the constraint, then asserts the resolved version matches, so a silent no-op fails the build. Both the success and failure paths were tested.Verification
All 6 jobs green on run 30265324531, and the logs confirm each row resolved its own req version (
resolved req: 0.5.15/0.6.3), 521 tests passing per row.The only warnings are from dependencies (
finch's deprecatedxref:option,actions/checkout@v4on Node 20) — none fromreq_cassette.