Skip to content

Commit fb8d6a9

Browse files
Thomas FinkThomas Fink
Thomas Fink
authored and
Thomas Fink
committed
chore(ZMS): fix running on php 8.0
1 parent a265a2c commit fb8d6a9

File tree

1 file changed

+14
-32
lines changed

1 file changed

+14
-32
lines changed

.github/workflows/php-code-coverage.yaml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,7 @@ on:
44
workflow_call:
55

66
jobs:
7-
setup:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v4
11-
12-
- name: Setup PHP
13-
uses: shivammathur/setup-php@v2
14-
with:
15-
php-version: '8.0'
16-
coverage: pcov
17-
tools: composer:v2
18-
ini-values: memory_limit=512M
19-
20-
- name: Cache PHP setup
21-
uses: actions/cache@v4
22-
with:
23-
path: |
24-
/opt/hostedtoolcache/php
25-
~/.composer/cache
26-
key: php-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
27-
restore-keys: |
28-
php-${{ runner.os }}-
29-
307
coverage:
31-
needs: setup
328
runs-on: ubuntu-latest
339
strategy:
3410
fail-fast: false
@@ -52,22 +28,28 @@ jobs:
5228
steps:
5329
- uses: actions/checkout@v4
5430

55-
- name: Restore PHP setup
56-
uses: actions/cache@v4
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
5733
with:
58-
path: |
59-
/opt/hostedtoolcache/php
60-
~/.composer/cache
61-
key: php-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
62-
restore-keys: |
63-
php-${{ runner.os }}-
34+
php-version: '8.0'
35+
coverage: pcov
36+
tools: composer:v2
37+
ini-values: memory_limit=512M
6438

6539
- name: Install dependencies
6640
working-directory: ${{ matrix.module }}
6741
run: composer install --prefer-dist --no-progress
6842

43+
- name: Add ReturnTypeWillChange attribute
44+
run: |
45+
if [ -f "zmsentities/src/Zmsentities/Schema/Entity.php" ]; then
46+
sed -i '1,/class Entity/s/class Entity/#[\ReturnTypeWillChange]\nclass Entity/' zmsentities/src/Zmsentities/Schema/Entity.php
47+
fi
48+
6949
- name: Run tests with coverage
7050
working-directory: ${{ matrix.module }}
51+
env:
52+
XDEBUG_MODE: coverage
7153
run: |
7254
mkdir -p coverage
7355
vendor/bin/phpunit --coverage-html coverage/html --coverage-clover coverage/clover.xml

0 commit comments

Comments
 (0)