From 5c711f7e7ee4daf6aba6053dec7c4042cfb489bd Mon Sep 17 00:00:00 2001 From: Nony Dutton Date: Thu, 9 Mar 2023 13:21:38 +0100 Subject: [PATCH] Separate CI job for test matrix success Partial backport of PR #309. Create a separate CI job that only succeeds if the entire matrix in the `tests` job passes. This allows us to have one required check instead of many. --- .github/workflows/ci.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5bfca0b..b0ed7ea6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push jobs: - test: + tests: runs-on: ubuntu-latest services: @@ -33,18 +33,14 @@ jobs: - rails5.2 - rails6.0 exclude: - - ruby-version: "2.7" - gemfile: rails4.2 - - ruby-version: "2.7" - gemfile: rails5.0 - - ruby-version: "2.7" - gemfile: rails5.1 - - ruby-version: "2.7" - gemfile: rails5.2 + - {ruby-version: "2.7", gemfile: rails4.2} + - {ruby-version: "2.7", gemfile: rails5.0} + - {ruby-version: "2.7", gemfile: rails5.1} + - {ruby-version: "2.7", gemfile: rails5.2} env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - - uses: zendesk/checkout@v2 + - uses: zendesk/checkout@v3 - name: Set up Ruby uses: zendesk/setup-ruby@v1 with: @@ -52,6 +48,21 @@ jobs: bundler-cache: true - run: bundle exec rake test + tests_successful: + name: Tests passing? + needs: tests + if: always() + runs-on: ubuntu-latest + steps: + - run: | + if ${{ needs.tests.result == 'success' }} + then + echo "All tests passed" + else + echo "Some tests failed" + false + fi + lint: runs-on: ubuntu-latest steps: