Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add status jobs #161

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -83,3 +83,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"
Loading