Skip to content

Commit

Permalink
DRY-up test workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Mar 26, 2024
1 parent a48754c commit f9fbb8c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,30 @@ jobs:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
gemfile: [rack_2_0, rack_3_0, rails_6_0, rails_6_1, rails_7_0, rails_7_1]
integration: [false]
gemfile: [Gemfile, gemfiles/rack_2_0.gemfile, gemfiles/rack_3_0.gemfile, gemfiles/rails_6_0.gemfile, gemfiles/rails_6_1.gemfile, gemfiles/rails_7_0.gemfile, gemfiles/rails_7_1.gemfile]
specs: ['spec --exclude-pattern=spec/integration/**/*_spec.rb']
include:
- ruby: '2.7'
gemfile: rack_1_0
gemfile: gemfiles/rack_1_0.gemfile
specs: 'spec/integration/rack_1_0'
- ruby: '2.7'
integration: multi_json
gemfile: gemfiles/multi_json.gemfile
specs: 'spec/integration/multi_json'
- ruby: '2.7'
integration: multi_xml
gemfile: gemfiles/multi_xml.gemfile
specs: 'spec/integration/multi_xml'
- ruby: '2.7'
integration: rack_2_0
gemfile: gemfiles/rack_2_0.gemfile
specs: 'spec/integration/rack_2_0'
- ruby: '2.7'
integration: rack_3_0
gemfile: gemfiles/rack_3_0.gemfile
specs: 'spec/integration/rack_3_0'
- ruby: '3.3'
integration: no_dry_validation
gemfile: gemfiles/no_dry_validation.gemfile
specs: 'spec/integration/no_dry_validation'
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.integration || matrix.gemfile }}.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4

Expand All @@ -51,13 +57,8 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
if: ${{ !matrix.integration }}
run: bundle exec rake spec

- name: Run integration tests (spec/integration/${{ matrix.integration }})
if: ${{ matrix.integration }}
run: bundle exec rspec spec/integration/${{ matrix.integration }}
- name: Run tests (${{ matrix.specs }})
run: bundle exec rspec ${{ matrix.specs }}

- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down

0 comments on commit f9fbb8c

Please sign in to comment.