diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c2df7d..6f767eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - master - # Dry run: on pull requests only the build job runs (tests, gem build, smoke test). + # Dry run: on pull requests only the test and build jobs run (tests, gem build, smoke test). pull_request: branches: - master @@ -19,12 +19,15 @@ concurrency: cancel-in-progress: false jobs: - build: - name: Test and build gem + # The test suite on every Ruby the gem allows (required_ruby_version in the gemspec is >= 3.0). + # Keep this list in step with that constraint. The gem itself is built once, in the build job. + test: + name: Test (Ruby ${{ matrix.ruby }}) runs-on: ubuntu-latest - outputs: - version: ${{ steps.build.outputs.version }} - gem_file: ${{ steps.build.outputs.gem_file }} + strategy: + fail-fast: false + matrix: + ruby: ['3.0', '3.1', '3.2', '3.3', '3.4'] steps: - name: Checkout repository uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 @@ -34,7 +37,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0 with: - ruby-version: '3.4' + ruby-version: ${{ matrix.ruby }} - name: Install dependencies run: bundle install @@ -43,6 +46,24 @@ jobs: - name: Run tests run: bundle exec ruby test/test_queueit_knownuserv3.rb + build: + name: Build gem + needs: test + runs-on: ubuntu-latest + outputs: + version: ${{ steps.build.outputs.version }} + gem_file: ${{ steps.build.outputs.gem_file }} + steps: + - name: Checkout repository + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false + + - name: Set up Ruby + uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0 + with: + ruby-version: '3.4' + - name: Build gem id: build run: |