From c228dc042b4d7d3730f5c07010feaeb5a772785a Mon Sep 17 00:00:00 2001 From: pezholio Date: Fri, 17 May 2024 12:00:49 +0100 Subject: [PATCH] Share Rails versions across matrices --- .github/workflows/rails-integration-tests.yml | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rails-integration-tests.yml b/.github/workflows/rails-integration-tests.yml index 9048730..f727abf 100644 --- a/.github/workflows/rails-integration-tests.yml +++ b/.github/workflows/rails-integration-tests.yml @@ -6,13 +6,25 @@ on: branches: - main +env: + RAILS_VERSIONS: '["5.2.8.1", "6.1.7.6", "7.1.3.2"]' + jobs: + set-matrix: + runs-on: ubuntu-latest + outputs: + RAILS_VERSIONS: ${{ env.RAILS_VERSIONS }} + steps: + - name: Compute outputs + run: | + echo "RAILS_VERSIONS=${{ env.RAILS_VERSIONS }}" >> $GITHUB_OUTPUT build-rails: strategy: fail-fast: false matrix: - rails: [ 5.2.8.1, 6.1.7.6, 7.1.3.2 ] + rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }} runs-on: ubuntu-latest + needs: set-matrix steps: - name: Checkout uses: actions/checkout@v4 @@ -40,9 +52,11 @@ jobs: strategy: fail-fast: false matrix: - rails: [ 5.2.8.1, 6.1.7.6, 7.1.3.2 ] + rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }} runs-on: ubuntu-latest - needs: build-rails + needs: + - set-matrix + - build-rails steps: - name: Download image uses: actions/download-artifact@v4 @@ -61,9 +75,11 @@ jobs: strategy: fail-fast: false matrix: - rails: [ 5.2.8.1, 6.1.7.6, 7.1.3.2 ] + rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }} runs-on: ubuntu-latest - needs: build-rails + needs: + - set-matrix + - build-rails steps: - name: Download image uses: actions/download-artifact@v4