.github/workflows/ci.yml
name: CI
on: push
jobs:
specs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- "3.3"
gemfile:
- rails6.0
- rails6.1
- rails7.0
- rails7.1
name: Ruby ${{ matrix.ruby-version }}, ${{ matrix.gemfile }}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: RSpec
run: bundle exec rspec
specs_successful:
name: Specs passing?
needs: specs
if: always()
runs-on: ubuntu-latest
steps:
- run: |
if ${{ needs.specs.result == 'success' }}
then
echo "All specs pass"
else
echo "Some specs failed"
false
fi