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