-
Notifications
You must be signed in to change notification settings - Fork 1.9k
181 lines (162 loc) · 5.35 KB
/
test-phpunit.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: PHPUnit
on:
push:
branches:
- develop
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
- 'tests/**.php'
- 'spark'
- composer.json
- phpunit.xml.dist
- .github/workflows/test-phpunit.yml
- .github/workflows/reusable-phpunit-test.yml
pull_request:
branches:
- develop
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
- 'tests/**.php'
- 'spark'
- composer.json
- phpunit.xml.dist
- .github/workflows/test-phpunit.yml
- .github/workflows/reusable-phpunit-test.yml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Any environment variables set in an env context defined at the workflow level
# in the caller workflow are not propagated to the called workflow.
coverage-php-version:
name: Setup PHP Version for Code Coverage
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.coverage-php-version.outputs.version }}
steps:
- id: coverage-php-version
run: |
echo "version=8.2" >> $GITHUB_OUTPUT
sanity-tests:
name: Others
needs: coverage-php-version
strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: Sanity Tests
php-version: ${{ matrix.php-version }}
job-id: sanity-tests
group-name: Others
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: imagick, redis, memcached
extra-composer-options: ${{ matrix.composer-option }}
database-live-tests:
name: DatabaseLive
needs:
- coverage-php-version
- sanity-tests
strategy:
fail-fast: false
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
db-platform:
- MySQLi
- OCI8
- Postgre
- SQLSRV
- SQLite3
mysql-version:
- '8.0'
include:
- php-version: '8.1'
db-platform: MySQLi
mysql-version: '5.7'
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: ''
php-version: ${{ matrix.php-version }}
job-id: database-live-tests
db-platform: ${{ matrix.db-platform }}
mysql-version: ${{ matrix.mysql-version }}
group-name: DatabaseLive
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: mysqli, oci8, pgsql, sqlsrv, sqlite3
extra-composer-options: ${{ matrix.composer-option }}
separate-process-tests:
name: SeparateProcess
needs:
- coverage-php-version
- sanity-tests
strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: ''
php-version: ${{ matrix.php-version }}
job-id: separate-process-tests
group-name: SeparateProcess
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-coverage: true # needs xdebug for assertHeaderEmitted() tests
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: mysqli, oci8, pgsql, sqlsrv-5.10.1, sqlite3
extra-composer-options: ${{ matrix.composer-option }}
cache-live-tests:
name: CacheLive
needs:
- coverage-php-version
- sanity-tests
strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
job-name: Cache Live Tests
php-version: ${{ matrix.php-version }}
job-id: cache-live-tests
group-name: CacheLive
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: redis, memcached
extra-composer-options: ${{ matrix.composer-option }}
coveralls:
name: Upload coverage results to Coveralls
if: github.repository_owner == 'codeigniter4'
needs:
- coverage-php-version
- sanity-tests
- cache-live-tests
- database-live-tests
- separate-process-tests
uses: ./.github/workflows/reusable-coveralls.yml # @TODO Extract to codeigniter4/.github repo
with:
php-version: ${{ needs.coverage-php-version.outputs.version }}