Run the test suite on GitHub Actions - #43
Open
facundofarias wants to merge 1 commit into
Open
facundofarias wants to merge 1 commit into
facundofarias wants to merge 1 commit into
Conversation
The repository has no CI, so the RSpec suite is only ever run locally and a change that breaks it can be merged without anyone noticing. Add a workflow that runs `rspec` on pushes to master and on every pull request, across Ruby 2.7 through 3.4. Two notes on the approach: * The suite is run without Bundler. Procodile has no runtime dependencies outside the standard library, and the committed Gemfile.lock pins rspec 3.5.x (2016), which does not install on current Rubies. Installing rspec directly keeps the whole matrix green without needing to change or delete the lockfile, which felt out of scope for adding CI. * Ruby 2.7 runs on ubuntu-22.04 because it is not available on the ubuntu-24.04 runner image. Verified locally against Ruby 2.7.8, 3.2.2, 3.3.8 and 3.4.9 (34 examples, 0 failures on each). 3.0 and 3.1 are included in the matrix but were not available locally to test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P89F451YDRDBj5br14i3GD
Author
|
Update on the two Rubies I couldn't test locally: the matrix has now been run end-to-end and all six jobs pass.
So 3.0 and 3.1 are confirmed rather than assumed, and the Run: https://github.com/deployhq/procodile/actions/runs/34689316464 I ran it on a fork-side copy of this PR because GitHub needs a maintainer to approve workflows on a first-time contributor's PR, so no checks appear here yet. Approving them on this PR should reproduce exactly the same result. |
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.
Problem
The repository has no CI configuration of any kind, so the RSpec suite only ever runs locally. A change that breaks it can be merged without anyone noticing, and contributors get no signal on a pull request.
Change
A single workflow that runs
rspecon pushes tomasterand on every pull request, across Ruby 2.7 through 3.4.Notes on the approach
The suite is run without Bundler. Procodile has no runtime dependencies outside the standard library, and the committed
Gemfile.lockpins rspec 3.5.x (2016) and json 2.2.0, which do not install on current Rubies. Installing rspec directly keeps the whole matrix green without changing or deleting the lockfile — that felt out of scope for a PR whose job is just to switch CI on. Happy to swap tobundler-cache: trueinstead if you'd rather drop the committed lockfile (which is the more usual convention for a gem); that's a one-line change here plus removing the file.Ruby 2.7 runs on
ubuntu-22.04because it isn't available on theubuntu-24.04runner image thatubuntu-latestnow resolves to. Everything else runs onubuntu-latest.Verification
Run locally against the Rubies I had available — 2.7.8, 3.2.2, 3.3.8 and 3.4.9 — 34 examples, 0 failures on each. 3.0 and 3.1 are in the matrix but I couldn't test them locally; they sit between two verified versions and the gem is pure Ruby, so I'd expect them to pass, and CI will say so definitively on this PR.
fail-fast: falseso one failing Ruby doesn't hide the others.If you'd like a build badge in the README I'm happy to add one, but I've left it out to keep this focused.