CI: drop unused coverage, generate matrix dynamically #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | ||
| name: Test | ||
| on: | ||
| pull_request: {} | ||
| push: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| rubocop_and_matrix: | ||
| runs-on: ubuntu-24.04 | ||
| outputs: | ||
| ruby: ${{ steps.ruby.outputs.versions }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Ruby ${{ matrix.ruby }} | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.4" | ||
| bundler-cache: true | ||
| - name: Run Rubocop | ||
| run: bundle exec rake rubocop | ||
| - id: ruby | ||
| uses: voxpupuli/ruby-version@v1 | ||
| spec: | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| needs: rubocop_and_matrix | ||
| fail-fast: false | ||
| matrix: | ||
| ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }} | ||
| name: RSpec - Ruby ${{ matrix.ruby }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Install Ruby ${{ matrix.ruby }} | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
| bundler-cache: true | ||
| - name: spec tests | ||
| run: bundle exec rake test:spec | ||
| - name: Build gem | ||
| run: gem build --strict --verbose *.gemspec | ||
| # It seems some additonal setup of Docker may be needed for | ||
| # the acceptance tests to work. | ||
| # - name: Run acceptance tests | ||
| # run: bundle exec rake test:acceptance | ||
| tests: | ||
| if: always() | ||
| needs: | ||
| - rubocop_and_matrix | ||
| - spec | ||
| runs-on: ubuntu-24.04 | ||
| name: Test suite | ||
| steps: | ||
| - name: Decide whether the needed jobs succeeded or failed | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||