Skip to content

Run the test suite on GitHub Actions - #43

Open
facundofarias wants to merge 1 commit into
adamcooke:masterfrom
deployhq:add-github-actions-ci
Open

facundofarias wants to merge 1 commit into
adamcooke:masterfrom
deployhq:add-github-actions-ci

Conversation

@facundofarias

Copy link
Copy Markdown

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 rspec on pushes to master and 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.lock pins 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 to bundler-cache: true instead 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.04 because it isn't available on the ubuntu-24.04 runner image that ubuntu-latest now resolves to. Everything else runs on ubuntu-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: false so 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.

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
@facundofarias

Copy link
Copy Markdown
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.

Ruby Runner Result
2.7 ubuntu-22.04 pass (46s)
3.0 ubuntu-latest pass (5s)
3.1 ubuntu-latest pass (8s)
3.2 ubuntu-latest pass (10s)
3.3 ubuntu-latest pass (8s)
3.4 ubuntu-latest pass (6s)

So 3.0 and 3.1 are confirmed rather than assumed, and the ubuntu-22.04 pin for 2.7 is confirmed necessary — that job builds Ruby 2.7 from source (hence 46s vs 5-10s elsewhere) because no prebuilt 2.7 exists for the 24.04 image.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant