-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 2.13 KB
/
test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Test
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
php-matrix:
uses: typisttech/.github/.github/workflows/php-matrix.yml@v2
permissions:
contents: read
pest:
runs-on: ubuntu-latest
needs: php-matrix
strategy:
matrix:
php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
dependency-versions: [lowest, highest]
coverage: [none]
exclude:
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: none
include:
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: xdebug
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependency-versions }}
composer-options: --no-audit --optimize-autoloader
- run: composer pest:unit -- --ci --coverage-clover coverage.xml
if: ${{ matrix.coverage == 'xdebug' }}
- run: composer pest:unit -- --ci
if: ${{ matrix.coverage != 'xdebug' }}
- run: composer pest:feature -- --ci
- run: composer pest:e2e -- --ci
- uses: actions/upload-artifact@v4
if: ${{ matrix.coverage == 'xdebug' }}
with:
name: coverage
path: coverage.xml
codecov:
needs: pest
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: coverage
- uses: codecov/codecov-action@v5
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}