-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (53 loc) · 1.52 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Testing Suite
on:
push:
branches:
- main
- '*.x'
- '*.*.x'
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
lint:
uses: alleyinteractive/.github/.github/workflows/php-composer-command.yml@main
with:
command: "lint"
php: 8.2
phpunit:
strategy:
fail-fast: false
matrix:
dependencies: ["lowest", "highest"]
multisite: [true, false]
php: [8.1, 8.2, 8.3]
wordpress: ["latest"]
uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main
name: "P${{ matrix.php }} - ${{ matrix.wordpress }} ${{ matrix.multisite && 'Multisite' || '' }} - ${{ matrix.dependencies }}"
with:
command: 'phpunit'
dependency-versions: ${{ matrix.dependencies }}
multisite: ${{ matrix.multisite }}
php: ${{ matrix.php }}
wordpress: ${{ matrix.wordpress }}
# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
name: All PR checks passed
needs:
- lint
- phpunit
runs-on: ubuntu-latest
if: always()
steps:
- name: Check job statuses
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more jobs failed"
exit 1
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs were cancelled"
exit 1
else
echo "All jobs passed or were skipped"
exit 0
fi