Skip to content

Commit e95c41b

Browse files
committed
Initial compatibility with PHP 8.1
1 parent 8b01f90 commit e95c41b

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/test-phpunit.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ on:
44
push:
55
branches:
66
- develop
7-
- '4.*'
87
paths:
9-
- 'app/**'
10-
- 'public/**'
11-
- 'system/**'
12-
- 'tests/**'
138
- composer.json
149
- spark
1510
- phpunit.xml.dist
@@ -18,35 +13,32 @@ on:
1813
pull_request:
1914
branches:
2015
- develop
21-
- '4.*'
2216
paths:
23-
- 'app/**'
24-
- 'public/**'
25-
- 'system/**'
26-
- 'tests/**'
2717
- composer.json
2818
- spark
2919
- phpunit.xml.dist
3020
- '**.php'
3121
- .github/workflows/test-phpunit.yml
3222

3323
jobs:
34-
3524
tests:
25+
name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
3626
runs-on: ubuntu-20.04
3727
if: "!contains(github.event.head_commit.message, '[ci skip]')"
38-
name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
3928

4029
strategy:
4130
fail-fast: false
4231
matrix:
43-
php-versions: ['7.3', '7.4', '8.0']
32+
php-versions: ['7.3', '7.4', '8.0', '8.1']
4433
db-platforms: ['MySQLi', 'Postgre', 'SQLite3', 'SQLSRV']
4534
mysql-versions: ['5.7']
4635
include:
4736
- php-versions: '7.4'
4837
db-platforms: MySQLi
4938
mysql-versions: '8.0'
39+
# @todo remove once 8.1 is stable enough
40+
- php-versions: '8.1'
41+
composer-flag: '--ignore-platform-req=php'
5042

5143
services:
5244
mysql:
@@ -57,6 +49,7 @@ jobs:
5749
ports:
5850
- 3306:3306
5951
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
52+
6053
postgres:
6154
image: postgres
6255
env:
@@ -66,6 +59,7 @@ jobs:
6659
ports:
6760
- 5432:5432
6861
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
62+
6963
mssql:
7064
image: mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04
7165
env:
@@ -75,11 +69,13 @@ jobs:
7569
ports:
7670
- 1433:1433
7771
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q 'SELECT @@VERSION'" --health-interval=10s --health-timeout=5s --health-retries=3
72+
7873
redis:
7974
image: redis
8075
ports:
8176
- 6379:6379
8277
options: --health-cmd "redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
78+
8379
memcached:
8480
image: memcached:1.6-alpine
8581
ports:
@@ -105,6 +101,7 @@ jobs:
105101

106102
- name: Install latest ImageMagick
107103
run: |
104+
sudo apt-get update
108105
sudo apt-get install --reinstall libgs9-common fonts-noto-mono libgs9:amd64 libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 gsfonts libopenjp2-7:amd64 fonts-droid-fallback ttf-dejavu-core
109106
sudo apt-get install -y imagemagick
110107
sudo apt-get install --fix-broken
@@ -122,13 +119,13 @@ jobs:
122119

123120
- name: Install dependencies
124121
run: |
125-
composer update --ansi --no-interaction
126-
composer remove --ansi --dev --unused -W rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
122+
composer update --ansi --no-interaction ${{ matrix.composer-flag }}
123+
composer remove --ansi --dev --unused -W ${{ matrix.composer-flag }} -- rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
127124
env:
128125
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
129126

130-
- name: Profile slow tests in PHP 7.4 MySQLi for now
131-
if: matrix.php-versions == '7.4' && matrix.db-platforms == 'MySQLi'
127+
- name: Profile slow tests in PHP 8.0
128+
if: matrix.php-versions == '8.0'
132129
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV
133130

134131
- name: Test with PHPUnit
@@ -137,8 +134,8 @@ jobs:
137134
DB: ${{ matrix.db-platforms }}
138135
TERM: xterm-256color
139136

140-
- if: github.repository_owner == 'codeigniter4' && matrix.php-versions == '7.4'
141-
name: Run Coveralls
137+
- name: Run Coveralls
138+
if: github.repository_owner == 'codeigniter4' && matrix.php-versions == '8.0'
142139
run: |
143140
composer global require --ansi php-coveralls/php-coveralls:^2.4
144141
php-coveralls --coverage_clover=build/logs/clover.xml -v
@@ -151,6 +148,7 @@ jobs:
151148
if: github.repository_owner == 'codeigniter4'
152149
needs: [tests]
153150
runs-on: ubuntu-20.04
151+
154152
steps:
155153
- name: Coveralls Finished
156154
uses: coverallsapp/github-action@master

0 commit comments

Comments
 (0)