Skip to content

Commit

Permalink
ci: Add status jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Nov 5, 2024
1 parent e8faff2 commit 234fb55
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Static analysis"
name: "AutoReview"

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
- cron: '0 0 1 * *'

jobs:
static-analysis:
phpstan:
runs-on: "ubuntu-latest"
name: "PHPStan on PHP ${{ matrix.php }}"
strategy:
Expand All @@ -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"
22 changes: 22 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 234fb55

Please sign in to comment.