From bcbde2c943d838ea5d12b7c7a4fb1a77d20c972d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:26:10 +0100 Subject: [PATCH] ci: Add meta job (#56) --- .github/workflows/ci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32fc3d7..0ebc993 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,3 +88,22 @@ jobs: - name: Run tests run: vendor/bin/phpunit --verbose --stop-on-failure + + # This is a "trick", a meta task which does not change, and we can use in + # the protected branch rules as opposed to the individual tests which + # may change regularly. + validate-tests: + name: Tests status + runs-on: ubuntu-latest + needs: + - php-cs-fixer + - phpunit + if: always() + steps: + - name: Successful run + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + + - name: Failing run + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1