2727 - phpunit.xml.dist
2828 - .github/workflows/test-phpunit.yml
2929
30+ concurrency :
31+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
32+ cancel-in-progress : true
33+
34+ env :
35+ COVERAGE_PHP_VERSION : ' 8.1'
36+ NLS_LANG : ' AMERICAN_AMERICA.UTF8'
37+ NLS_DATE_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
38+ NLS_TIMESTAMP_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
39+ NLS_TIMESTAMP_TZ_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
40+
3041jobs :
3142 tests :
3243 name : PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
33- runs-on : ubuntu-20 .04
44+ runs-on : ubuntu-22 .04
3445 if : " !contains(github.event.head_commit.message, '[ci skip]')"
3546
3647 strategy :
6576 options : --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
6677
6778 mssql :
68- image : mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04
79+ image : mcr.microsoft.com/mssql/server:2022-latest
6980 env :
7081 SA_PASSWORD : 1Secure*Password1
7182 ACCEPT_EULA : Y
@@ -75,12 +86,18 @@ jobs:
7586 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
7687
7788 oracle :
78- image : quillbuilduser /oracle-18-xe
89+ image : gvenzl /oracle-xe:21
7990 env :
80- ORACLE_ALLOW_REMOTE : true
91+ ORACLE_RANDOM_PASSWORD : true
92+ APP_USER : ORACLE
93+ APP_USER_PASSWORD : ORACLE
8194 ports :
8295 - 1521:1521
83- options : --health-cmd="/opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s sys/Oracle18@oracledbxe/XE as sysdba <<< 'SELECT 1 FROM DUAL'" --health-interval=10s --health-timeout=5s --health-retries=3
96+ options : >-
97+ --health-cmd healthcheck.sh
98+ --health-interval 20s
99+ --health-timeout 10s
100+ --health-retries 10
84101
85102 redis :
86103 image : redis
@@ -98,28 +115,6 @@ jobs:
98115 if : matrix.db-platforms == 'SQLSRV'
99116 run : sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test"
100117
101- - name : Install Oracle InstantClient
102- if : matrix.db-platforms == 'OCI8'
103- run : |
104- sudo apt-get install wget libaio1 alien
105- sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm
106- sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm
107- sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
108- sudo alien oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm
109- sudo alien oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm
110- sudo alien oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
111- sudo dpkg -i oracle-instantclient18.5-basic_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-devel_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-sqlplus_18.5.0.0.0-4_amd64.deb
112- echo "LD_LIBRARY_PATH=/lib/oracle/18.5/client64/lib/" >> $GITHUB_ENV
113- echo "NLS_LANG=AMERICAN_AMERICA.UTF8" >> $GITHUB_ENV
114- echo "C_INCLUDE_PATH=/usr/include/oracle/18.5/client64" >> $GITHUB_ENV
115- echo 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
116- echo 'NLS_TIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
117- echo 'NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV
118-
119- - name : Create database for Oracle Database
120- if : matrix.db-platforms == 'OCI8'
121- run : echo -e "ALTER SESSION SET CONTAINER = XEPDB1;\nCREATE BIGFILE TABLESPACE \"TEST\" DATAFILE '/opt/oracle/product/18c/dbhomeXE/dbs/TEST' SIZE 10M AUTOEXTEND ON MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO EXTENT MANAGEMENT LOCAL AUTOALLOCATE;\nCREATE USER \"ORACLE\" IDENTIFIED BY \"ORACLE\" DEFAULT TABLESPACE \"TEST\" TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON \"TEST\";\nGRANT CONNECT,RESOURCE TO \"ORACLE\";\nexit;" | /lib/oracle/18.5/client64/bin/sqlplus -s sys/Oracle18@localhost:1521/XE as sysdba
122-
123118 - name : Checkout
124119 uses : actions/checkout@v3
125120
@@ -129,70 +124,110 @@ jobs:
129124 php-version : ${{ matrix.php-versions }}
130125 tools : composer, pecl
131126 extensions : imagick, sqlsrv, gd, sqlite3, redis, memcached, oci8, pgsql
132- coverage : xdebug
127+ coverage : ${{ env.COVERAGE_DRIVER }}
133128 env :
134129 update : true
130+ COVERAGE_DRIVER : ${{ matrix.php-versions == env.COVERAGE_PHP_VERSION && 'xdebug' || 'none'}}
135131
136132 - name : Install latest ImageMagick
137133 run : |
138134 sudo apt-get update
139- 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
135+ 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 fonts -dejavu-core
140136 sudo apt-get install -y imagemagick
141137 sudo apt-get install --fix-broken
142138
143139 - name : Get composer cache directory
144- id : composercache
145- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
140+ run : echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
146141
147142 - name : Cache dependencies
148143 uses : actions/cache@v3
149144 with :
150- path : ${{ steps.composercache.outputs.dir }}
145+ path : ${{ env.COMPOSER_CACHE_FILES_DIR }}
151146 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
152147 restore-keys : ${{ runner.os }}-composer-
153148
154149 - name : Install dependencies
155150 run : |
156151 composer update --ansi --no-interaction
157152 composer remove --ansi --dev --unused -W -- rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
158- env :
159- COMPOSER_AUTH : ${{ secrets.COMPOSER_AUTH }}
160153
161- - name : Profile slow tests in PHP 8.0
162- if : matrix.php-versions == '8.0'
154+ - name : Profile slow tests in PHP ${{ env.COVERAGE_PHP_VERSION }}
155+ if : matrix.php-versions == env.COVERAGE_PHP_VERSION
163156 run : echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV
164157
165158 - name : Compute coverage option
166159 uses : actions/github-script@v6
167160 id : phpunit-coverage-option
168161 with :
169- script : ' return "${{ matrix.php-versions }}" == "8.0" ? "" : "--no-coverage"'
162+ script : |
163+ const { COVERAGE_NAME } = process.env
164+
165+ return "${{ matrix.php-versions }}" == "${{ env.COVERAGE_PHP_VERSION }}" ? `--coverage-php build/cov/coverage-${COVERAGE_NAME}.cov` : "--no-coverage"
170166 result-encoding : string
167+ env :
168+ COVERAGE_NAME : php-v${{ env.COVERAGE_PHP_VERSION }}-${{ matrix.db-platforms }}
171169
172170 - name : Test with PHPUnit
173171 run : script -e -c "vendor/bin/phpunit --color=always --exclude-group=auto-review ${{ steps.phpunit-coverage-option.outputs.result }}"
174172 env :
175173 DB : ${{ matrix.db-platforms }}
176174 TERM : xterm-256color
177175
178- - name : Run Coveralls
179- if : github.repository_owner == 'codeigniter4' && matrix.php-versions == '8.0'
180- run : |
181- composer global require --ansi php-coveralls/php-coveralls:^2.4
182- php-coveralls --coverage_clover=build/logs/clover.xml -v
176+ - name : Upload coverage file
177+ if : matrix.php-versions == env.COVERAGE_PHP_VERSION
178+ uses : actions/upload-artifact@v3
179+ with :
180+ name : ${{ env.COVERAGE_NAME }}
181+ path : build/cov/coverage-${{ env.COVERAGE_NAME }}.cov
182+ if-no-files-found : error
183+ retention-days : 1
183184 env :
184- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185- COVERALLS_PARALLEL : true
186- COVERALLS_FLAG_NAME : PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
185+ COVERAGE_NAME : php-v${{ env.COVERAGE_PHP_VERSION }}-${{ matrix.db-platforms }}
187186
188- coveralls-finish :
187+ coveralls :
189188 if : github.repository_owner == 'codeigniter4'
190- needs : [ tests]
191- runs-on : ubuntu-20 .04
189+ needs : tests
190+ runs-on : ubuntu-22 .04
192191
193192 steps :
194- - name : Coveralls Finished
195- uses : coverallsapp/github-action@master
193+ - name : Checkout
194+ uses : actions/checkout@v3
195+
196+ - name : Setup PHP, with composer and extensions
197+ uses : shivammathur/setup-php@v2
198+ with :
199+ php-version : ${{ env.COVERAGE_PHP_VERSION }}
200+ tools : composer
201+ coverage : xdebug
202+ env :
203+ update : true
204+
205+ - name : Download coverage files
206+ uses : actions/download-artifact@v3
207+ with :
208+ path : build/cov
209+
210+ - name : Display structure of downloaded files
211+ run : ls -R
212+ working-directory : build/cov
213+
214+ - name : Get composer cache directory
215+ run : echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
216+
217+ - name : Cache dependencies
218+ uses : actions/cache@v3
196219 with :
197- github-token : ${{ secrets.GITHUB_TOKEN }}
198- parallel-finished : true
220+ path : ${{ env.COMPOSER_CACHE_FILES_DIR }}
221+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
222+ restore-keys : ${{ runner.os }}-composer-
223+
224+ - name : Install dependencies
225+ run : composer update --ansi --no-interaction
226+
227+ - name : Merge coverage files
228+ run : vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
229+
230+ - name : Upload coverage to Coveralls
231+ run : vendor/bin/php-coveralls --verbose --exclude-no-stmt --ansi
232+ env :
233+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments