From 1bb14caf6237fe6ea1cbe38f5cb580809aedabc0 Mon Sep 17 00:00:00 2001 From: Facundo Farias Date: Sat, 12 Sep 2026 12:44:51 +0200 Subject: [PATCH] Run the test suite on GitHub Actions 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) Claude-Session: https://claude.ai/code/session_01P89F451YDRDBj5br14i3GD --- .github/workflows/tests.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e61ecbd --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,38 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + +jobs: + rspec: + name: RSpec (Ruby ${{ matrix.ruby }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + ruby: ['3.0', '3.1', '3.2', '3.3', '3.4'] + os: [ubuntu-latest] + include: + # Ruby 2.7 is not available on the ubuntu-24.04 runner image. + - ruby: '2.7' + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + # Procodile has no runtime dependencies outside the standard library, and the + # committed Gemfile.lock pins rspec 3.5.x (2016), which will not install on + # current Rubies. Installing rspec directly keeps every Ruby in the matrix + # working without needing to touch the lockfile. + - name: Install rspec + run: gem install rspec --no-document + + - name: Run tests + run: rspec -Ilib