diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 554d818..3d7b292 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,4 +1,4 @@ -name: "Static analysis" +name: "AutoReview" on: push: @@ -10,7 +10,7 @@ on: - cron: '0 0 1 * *' jobs: - static-analysis: + phpstan: runs-on: "ubuntu-latest" name: "PHPStan on PHP ${{ matrix.php }}" strategy: @@ -35,3 +35,24 @@ jobs: - name: "Perform static analysis" run: "make phpstan" + + + # This is a "trick", a meta task which does not change, and we can use in + # the protected branch rules as opposed to the E2E tests one above which + # may change regularly. + # This allows us to mark only this job as required instead of each individual + # ever-changing E2E tests. + validate-tests: + name: "AutoReview Status" + runs-on: "ubuntu-latest" + needs: + - "phpstan" + 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" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4d8c0cc..035970f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -81,3 +81,25 @@ jobs: - name: "Run tests" run: "vendor/bin/phpunit --group e2e" + + + # This is a "trick", a meta task which does not change, and we can use in + # the protected branch rules as opposed to the E2E tests one above which + # may change regularly. + # This allows us to mark only this job as required instead of each individual + # ever-changing E2E tests. + validate-tests: + name: "Tests Status" + runs-on: "ubuntu-latest" + needs: + - "unit-tests" + - "e2e-tests" + 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"