Skip to content

Commit

Permalink
Use matrix to reduce duplication in CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
padde committed Sep 19, 2024
1 parent a6b31de commit 7a472d6
Showing 1 changed file with 35 additions and 165 deletions.
200 changes: 35 additions & 165 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,182 +22,52 @@ jobs:
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop --parallel --format progress

grape-17:
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: '1.7.1'
test:
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run rspec wo model parser
run: |
bundle update
bundle exec rspec
- name: Run rspec w entity parser
env:
MODEL_PARSER: grape-swagger-entity
run: |
bundle update
bundle exec rspec
- name: Run rspec w representable parser
env:
MODEL_PARSER: grape-swagger-representable
run: |
bundle update
bundle exec rspec
grape-18:
entry:
- {ruby: '3.0', grape: '1.7.1'}
- {ruby: '3.1', grape: '1.7.1'}
- {ruby: '3.2', grape: '1.7.1'}
- {ruby: '3.3', grape: '1.7.1'}
- {ruby: 'head', grape: '1.7.1'}
- {ruby: '3.0', grape: '1.8.0'}
- {ruby: '3.1', grape: '1.8.0'}
- {ruby: '3.2', grape: '1.8.0'}
- {ruby: '3.3', grape: '1.8.0'}
- {ruby: 'head', grape: '1.8.0'}
- {ruby: '3.0', grape: '2.0.0'}
- {ruby: '3.1', grape: '2.0.0'}
- {ruby: '3.2', grape: '2.0.0'}
- {ruby: '3.3', grape: '2.0.0'}
- {ruby: 'head', grape: '2.0.0'}
- {ruby: '3.0', grape: '2.1.3'}
- {ruby: '3.1', grape: '2.1.3'}
- {ruby: '3.2', grape: '2.1.3'}
- {ruby: '3.3', grape: '2.1.3'}
- {ruby: 'head', grape: '2.1.3'}
- {ruby: '3.0', grape: '2.2.0'}
- {ruby: '3.1', grape: '2.2.0'}
- {ruby: '3.2', grape: '2.2.0'}
- {ruby: '3.3', grape: '2.2.0'}
- {ruby: 'head', grape: '2.2.0'}
- {ruby: '3.0', grape: 'HEAD'}
- {ruby: '3.1', grape: 'HEAD'}
- {ruby: '3.2', grape: 'HEAD'}
- {ruby: '3.3', grape: 'HEAD'}
- {ruby: 'head', grape: 'HEAD'}
name: test (ruby=${{ matrix.entry.ruby }}, grape=${{ matrix.entry.grape }})
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: '1.8.0'
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run rspec wo model parser
run: |
bundle update
bundle exec rspec
- name: Run rspec w entity parser
env:
MODEL_PARSER: grape-swagger-entity
run: |
bundle update
bundle exec rspec
- name: Run rspec w representable parser
env:
MODEL_PARSER: grape-swagger-representable
run: |
bundle update
bundle exec rspec
grape-20:
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: '2.0.0'
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run rspec wo model parser
run: |
bundle update
bundle exec rspec
- name: Run rspec w entity parser
env:
MODEL_PARSER: grape-swagger-entity
run: |
bundle update
bundle exec rspec
- name: Run rspec w representable parser
env:
MODEL_PARSER: grape-swagger-representable
run: |
bundle update
bundle exec rspec
grape-21:
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: '2.1.3'
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run rspec wo model parser
run: |
bundle update
bundle exec rspec
- name: Run rspec w entity parser
env:
MODEL_PARSER: grape-swagger-entity
run: |
bundle update
bundle exec rspec
- name: Run rspec w representable parser
env:
MODEL_PARSER: grape-swagger-representable
run: |
bundle update
bundle exec rspec
grape-22:
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: '2.2.0'
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run rspec wo model parser
run: |
bundle update
bundle exec rspec
- name: Run rspec w entity parser
env:
MODEL_PARSER: grape-swagger-entity
run: |
bundle update
bundle exec rspec
- name: Run rspec w representable parser
env:
MODEL_PARSER: grape-swagger-representable
run: |
bundle update
bundle exec rspec
grape-HEAD:
runs-on: ubuntu-latest
needs: ['rubocop']
env:
GRAPE_VERSION: 'HEAD'
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head']
GRAPE_VERSION: ${{ matrix.entry.grape }}
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
ruby-version: ${{ matrix.entry.ruby }}
- name: Run rspec wo model parser
run: |
bundle update
Expand Down

0 comments on commit 7a472d6

Please sign in to comment.