@@ -3,220 +3,99 @@ name: CI
33on :
44 push :
55 pull_request :
6- schedule :
7- - cron : ' 0 0 * * 0'
6+
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.ref }}
9+ cancel-in-progress : true
810
911jobs :
1012 tests :
1113 name : Tests (PHP ${{ matrix.php }}, PostgreSQL ${{ matrix.postgres }}, PostGIS ${{ matrix.postgis }}, ORM ${{ matrix.orm || 'default' }}, DBAL ${{ matrix.dbal || 'default' }})
1214 runs-on : ubuntu-latest
1315 strategy :
16+ fail-fast : false
1417 matrix :
1518 include :
1619 # Lowest deps
17- - php : ' 8.0'
18- postgres : ' 11'
19- postgis : ' 3.0'
20- phpunit-flags : ' --exclude-group=versioned'
21- composer-flags : ' --prefer-stable --prefer-lowest'
22- - php : ' 8.0'
23- postgres : ' 11'
24- postgis : ' 3.0'
25- phpunit-flags : ' --group=postgis-3.0'
26- composer-flags : ' --prefer-stable --prefer-lowest'
27-
28- # PostgresSQL / PostGIS matrix with ORM
29- # PHP 8.1, Postgres 11, ORM 2.9
30- - php : ' 8.1'
31- postgres : ' 11'
32- postgis : ' 3.0'
33- orm : ' 2.9'
34- phpunit-flags : ' --exclude-group=versioned'
35- - php : ' 8.1'
36- postgres : ' 11'
37- postgis : ' 3.0'
38- orm : ' 2.9'
39- phpunit-flags : ' --group=postgis-3.0'
4020 - php : ' 8.1'
41- postgres : ' 11'
42- postgis : ' 3.1'
43- orm : ' 2.9'
44- phpunit-flags : ' --exclude-group=versioned'
45- - php : ' 8.1'
46- postgres : ' 11'
47- postgis : ' 3.1'
48- orm : ' 2.9'
49- phpunit-flags : ' --group=postgis-3.1'
50- - php : ' 8.1'
51- postgres : ' 11'
21+ postgres : ' 14'
5222 postgis : ' 3.2'
53- orm : ' 2.9'
5423 phpunit-flags : ' --exclude-group=versioned'
24+ composer-flags : ' --prefer-stable --prefer-lowest'
5525 - php : ' 8.1'
56- postgres : ' 11 '
26+ postgres : ' 14 '
5727 postgis : ' 3.2'
58- orm : ' 2.9'
5928 phpunit-flags : ' --group=postgis-3.2'
29+ composer-flags : ' --prefer-stable --prefer-lowest'
30+
31+ # PostgresSQL / PostGIS matrix with ORM
32+ # PHP 8.1, Postgres 15, ORM 2.19
6033 - php : ' 8.1'
61- postgres : ' 11'
62- postgis : ' 3.3'
63- orm : ' 2.9'
64- phpunit-flags : ' --exclude-group=versioned'
65- - php : ' 8.1'
66- postgres : ' 11'
67- postgis : ' 3.3'
68- orm : ' 2.9'
69- phpunit-flags : ' --group=postgis-3.3'
70- - php : ' 8.1'
71- postgres : ' 11'
34+ postgres : ' 15'
7235 postgis : ' 3.4'
73- orm : ' 2.9 '
36+ orm : ' 2.19 '
7437 phpunit-flags : ' --exclude-group=versioned'
7538 - php : ' 8.1'
76- postgres : ' 11 '
39+ postgres : ' 15 '
7740 postgis : ' 3.4'
78- orm : ' 2.9 '
41+ orm : ' 2.19 '
7942 phpunit-flags : ' --group=postgis-3.4'
80- # PHP 8.1, Postgres 12, ORM 2.9
81- - php : ' 8.1'
82- postgres : ' 12'
83- postgis : ' 3.0'
84- orm : ' 2.9'
85- phpunit-flags : ' --exclude-group=versioned'
86- - php : ' 8.1'
87- postgres : ' 12'
88- postgis : ' 3.0'
89- orm : ' 2.9'
90- phpunit-flags : ' --group=postgis-3.0'
91- - php : ' 8.1'
92- postgres : ' 12'
93- postgis : ' 3.1'
94- orm : ' 2.9'
95- phpunit-flags : ' --exclude-group=versioned'
96- - php : ' 8.1'
97- postgres : ' 12'
98- postgis : ' 3.1'
99- orm : ' 2.9'
100- phpunit-flags : ' --group=postgis-3.1'
101- - php : ' 8.1'
102- postgres : ' 12'
103- postgis : ' 3.2'
104- orm : ' 2.9'
105- phpunit-flags : ' --exclude-group=versioned'
106- - php : ' 8.1'
107- postgres : ' 12'
108- postgis : ' 3.2'
109- orm : ' 2.9'
110- phpunit-flags : ' --group=postgis-3.2'
111- - php : ' 8.1'
112- postgres : ' 12'
113- postgis : ' 3.3'
114- orm : ' 2.9'
115- phpunit-flags : ' --exclude-group=versioned'
116- - php : ' 8.1'
117- postgres : ' 12'
118- postgis : ' 3.3'
119- orm : ' 2.9'
120- phpunit-flags : ' --group=postgis-3.3'
43+
44+ # PHP 8.1, Postgres 16, ORM 2.19
12145 - php : ' 8.1'
122- postgres : ' 12 '
46+ postgres : ' 16 '
12347 postgis : ' 3.4'
124- orm : ' 2.9 '
48+ orm : ' 2.19 '
12549 phpunit-flags : ' --exclude-group=versioned'
12650 - php : ' 8.1'
127- postgres : ' 12 '
51+ postgres : ' 16 '
12852 postgis : ' 3.4'
129- orm : ' 2.9 '
53+ orm : ' 2.19 '
13054 phpunit-flags : ' --group=postgis-3.4'
131- # PHP 8.1, Postgres 13, ORM 2.9
132- - php : ' 8.1'
133- postgres : ' 13'
134- postgis : ' 3.0'
135- orm : ' 2.9'
136- phpunit-flags : ' --exclude-group=versioned'
137- - php : ' 8.1'
138- postgres : ' 13'
139- postgis : ' 3.0'
140- orm : ' 2.9'
141- phpunit-flags : ' --group=postgis-3.0'
142- - php : ' 8.1'
143- postgres : ' 13'
144- postgis : ' 3.1'
145- orm : ' 2.9'
146- phpunit-flags : ' --exclude-group=versioned'
147- - php : ' 8.1'
148- postgres : ' 13'
149- postgis : ' 3.1'
150- orm : ' 2.9'
151- phpunit-flags : ' --group=postgis-3.1'
152- - php : ' 8.1'
153- postgres : ' 13'
154- postgis : ' 3.2'
155- orm : ' 2.9'
156- phpunit-flags : ' --exclude-group=versioned'
157- - php : ' 8.1'
158- postgres : ' 13'
159- postgis : ' 3.2'
160- orm : ' 2.9'
161- phpunit-flags : ' --group=postgis-3.2'
55+
56+ # PHP 8.1, Postgres 17, ORM 3.5
16257 - php : ' 8.1'
163- postgres : ' 13 '
164- postgis : ' 3.3 '
165- orm : ' 2.9 '
58+ postgres : ' 17 '
59+ postgis : ' 3.6 '
60+ orm : ' 3.5 '
16661 phpunit-flags : ' --exclude-group=versioned'
16762 - php : ' 8.1'
168- postgres : ' 13'
169- postgis : ' 3.3'
170- orm : ' 2.9'
171- phpunit-flags : ' --group=postgis-3.3'
63+ postgres : ' 17'
64+ postgis : ' 3.6'
65+ orm : ' 3.5'
66+ phpunit-flags : ' --group=postgis-3.6'
67+
68+ # PHP 8.1, Postgres 18, ORM 3.5
17269 - php : ' 8.1'
173- postgres : ' 13 '
174- postgis : ' 3.4 '
175- orm : ' 2.9 '
70+ postgres : ' 18 '
71+ postgis : ' 3.6 '
72+ orm : ' 3.5 '
17673 phpunit-flags : ' --exclude-group=versioned'
177- code-coverage : ' yes'
17874 - php : ' 8.1'
179- postgres : ' 13 '
180- postgis : ' 3.4 '
181- orm : ' 2.9 '
182- phpunit-flags : ' --group=postgis-3.4 '
75+ postgres : ' 18 '
76+ postgis : ' 3.6 '
77+ orm : ' 3.5 '
78+ phpunit-flags : ' --group=postgis-3.6 '
18379 code-coverage : ' yes'
18480
185- # DBAL only
186- - php : ' 8.1'
187- postgres : ' 11'
188- postgis : ' 3.0'
189- dbal : ' 2.13'
190- phpunit-flags : ' --exclude-group=versioned,orm'
191- - php : ' 8.1'
192- postgres : ' 11'
193- postgis : ' 3.0'
194- dbal : ' 2.13'
195- phpunit-flags : ' --group=postgis-3.0 --exclude-group=orm'
196- - php : ' 8.1'
197- postgres : ' 13'
198- postgis : ' 3.1'
199- dbal : ' 3.1'
200- phpunit-flags : ' --exclude-group=versioned,orm'
201- - php : ' 8.1'
202- postgres : ' 13'
203- postgis : ' 3.1'
204- dbal : ' 3.1'
205- phpunit-flags : ' --group=postgis-3.1 --exclude-group=orm'
81+ # DBAL only v3 & v4
82+ - php : ' 8.1'
83+ postgres : ' 18'
84+ postgis : ' 3.6'
85+ dbal : ' 3.7'
86+ phpunit-flags : ' --group=postgis-3.6 --exclude-group=orm'
87+ - php : ' 8.4'
88+ postgres : ' 18'
89+ postgis : ' 3.6'
90+ dbal : ' 4.3'
91+ phpunit-flags : ' --group=postgis-3.6 --exclude-group=orm'
20692
20793 # Next PHP version
208- - php : ' 8.2 '
209- postgres : ' 13 '
210- postgis : ' 3.1 '
94+ - php : ' latest '
95+ postgres : ' 18 '
96+ postgis : ' 3.6 '
21197 phpunit-flags : ' --exclude-group=versioned'
212- composer-flags : ' --ignore-platform-reqs'
213- experimental : true
214- - php : ' 8.2'
215- postgres : ' 13'
216- postgis : ' 3.1'
217- phpunit-flags : ' --group=postgis-3.1'
218- composer-flags : ' --ignore-platform-reqs'
219- experimental : true
98+
22099 services :
221100 postgis :
222101 image : postgis/postgis:${{ matrix.postgres }}-${{ matrix.postgis }}-alpine
@@ -232,14 +111,25 @@ jobs:
232111
233112 steps :
234113 - name : Checkout code
235- uses : actions/checkout@v4
114+ uses : actions/checkout@v5
236115
237116 - name : Setup PHP
238117 uses : shivammathur/setup-php@v2
239118 with :
240119 php-version : ${{ matrix.php }}
241- extensions : pdo_pgsql
242- coverage : pcov
120+ extensions : pdo_pgsql, pgsql
121+ coverage : ${{ matrix.code-coverage == 'yes' && 'xdebug' || 'none' }}
122+
123+ - name : Get Composer cache directory
124+ id : composer-cache
125+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
126+
127+ - name : Cache Composer dependencies
128+ uses : actions/cache@v4
129+ with :
130+ path : ${{ steps.composer-cache.outputs.dir }}
131+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
132+ restore-keys : ${{ runner.os }}-composer-
243133
244134 - name : Install Doctrine ORM
245135 if : matrix.orm != ''
@@ -254,20 +144,25 @@ jobs:
254144 - name : Install dependencies
255145 run : |
256146 composer update --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}
257- composer info -D
258-
259- - name : Run tests
260- if : matrix.code-coverage != 'yes'
261- run : vendor/bin/phpunit ${{ matrix.phpunit-flags }}
147+ composer show -D
262148
263- - name : Run tests with code coverage
149+ - name : Create coverage directory
264150 if : matrix.code-coverage == 'yes'
265- run : vendor/bin/phpunit --coverage-clover build/logs/clover.xml ${{ matrix.phpunit-flags }}
151+ run : mkdir -p build/logs
266152
267- - name : Upload coverage results to Coveralls
268- if : matrix.code-coverage == 'yes'
269- env :
270- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153+ - name : Run tests
271154 run : |
272- composer global require php-coveralls/php-coveralls
273- php-coveralls -v --coverage_clover=build/logs/clover.xml
155+ if [ "${{ matrix.code-coverage }}" == "yes" ]; then
156+ vendor/bin/phpunit --coverage-clover build/logs/clover.xml ${{ matrix.phpunit-flags }}
157+ else
158+ vendor/bin/phpunit ${{ matrix.phpunit-flags }}
159+ fi
160+
161+ - name : Upload coverage to Coveralls
162+ if : matrix.code-coverage == 'yes' && success()
163+ uses : coverallsapp/github-action@v2
164+ with :
165+ github-token : ${{ secrets.GITHUB_TOKEN }}
166+ file : build/logs/clover.xml
167+ flag-name : php-${{ matrix.php }}-pg${{ matrix.postgres }}-postgis${{ matrix.postgis }}
168+ parallel : true
0 commit comments