Skip to content

Commit bbe4925

Browse files
authored
ci: Add status jobs (#161)
1 parent dd85bcb commit bbe4925

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.github/workflows/phpstan.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Static analysis"
1+
name: "AutoReview"
22

33
on:
44
push:
@@ -10,7 +10,7 @@ on:
1010
- cron: '0 0 1 * *'
1111

1212
jobs:
13-
static-analysis:
13+
phpstan:
1414
runs-on: "ubuntu-latest"
1515
name: "PHPStan on PHP ${{ matrix.php }}"
1616
strategy:
@@ -35,3 +35,24 @@ jobs:
3535

3636
- name: "Perform static analysis"
3737
run: "make phpstan"
38+
39+
40+
# This is a "trick", a meta task which does not change, and we can use in
41+
# the protected branch rules as opposed to the E2E tests one above which
42+
# may change regularly.
43+
# This allows us to mark only this job as required instead of each individual
44+
# ever-changing E2E tests.
45+
validate-tests:
46+
name: "AutoReview Status"
47+
runs-on: "ubuntu-latest"
48+
needs:
49+
- "phpstan"
50+
if: "always()"
51+
steps:
52+
- name: "Successful run"
53+
if: "${{ !(contains(needs.*.result, 'failure')) }}"
54+
run: "exit 0"
55+
56+
- name: "Failing run"
57+
if: "${{ contains(needs.*.result, 'failure') }}"
58+
run: "exit 1"

.github/workflows/tests.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,25 @@ jobs:
8383

8484
- name: "Run tests"
8585
run: "vendor/bin/phpunit --group e2e"
86+
87+
88+
# This is a "trick", a meta task which does not change, and we can use in
89+
# the protected branch rules as opposed to the E2E tests one above which
90+
# may change regularly.
91+
# This allows us to mark only this job as required instead of each individual
92+
# ever-changing E2E tests.
93+
validate-tests:
94+
name: "Tests Status"
95+
runs-on: "ubuntu-latest"
96+
needs:
97+
- "unit-tests"
98+
- "e2e-tests"
99+
if: "always()"
100+
steps:
101+
- name: "Successful run"
102+
if: "${{ !(contains(needs.*.result, 'failure')) }}"
103+
run: "exit 0"
104+
105+
- name: "Failing run"
106+
if: "${{ contains(needs.*.result, 'failure') }}"
107+
run: "exit 1"

0 commit comments

Comments
 (0)