Skip to content

Commit 75d48b8

Browse files
committed
Add job with PHPUnit 12 to CI
1 parent 1a8a3d9 commit 75d48b8

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
php-version: '8.4'
2323
extensions: none, curl, dom, json, mbstring, opcache, openssl, simplexml, tokenizer, xml, xmlwriter
2424
coverage: none
25-
- if: ${{ github.event_name != 'pull_request' }}
25+
- if: github.event_name != 'pull_request'
2626
run: rm ./.dev-tools/composer.lock
2727
- run: composer update --no-progress
2828
- run: composer analyse
@@ -75,6 +75,10 @@ jobs:
7575
description: 'on Windows'
7676
php-version: '8.4'
7777
FAST_LINT_TEST_CASES: 1
78+
- os: ubuntu-latest
79+
description: 'with PHPUnit 12'
80+
php-version: '8.4'
81+
install-phpunit-12: true
7882
- os: ubuntu-latest
7983
php-version: '8.5'
8084
runs-on: ${{ matrix.os }}
@@ -100,37 +104,43 @@ jobs:
100104
path: ${{ steps.composer-cache.outputs.dir }}
101105
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
102106

103-
- if: ${{ matrix.with-bootstrap }}
107+
- if: matrix.with-bootstrap
104108
uses: sergeysova/jq-action@v2
105109
with:
106110
cmd: |
107111
jq -r --indent 4 'del(.autoload."psr-4")' composer.json > composer.tmp
108112
jq -r --indent 4 '.autoload += {"files": ["bootstrap.php"]}' composer.tmp > composer.json
109113
110-
- if: ${{ matrix.use-shim-package }}
114+
- if: matrix.use-shim-package
111115
run: sed -i 's#friendsofphp/php-cs-fixer#php-cs-fixer/shim#g' composer.json
112116

113-
- if: ${{ matrix.with-php-cs-fixer-from-master }}
117+
- if: matrix.with-php-cs-fixer-from-master
114118
run: composer require friendsofphp/php-cs-fixer:dev-master --no-update
115119

116-
- if: ${{ matrix.calculate-coverage }}
120+
- if: matrix.calculate-coverage
117121
run: composer require --dev php-coveralls/php-coveralls --no-update
118122

123+
- if: matrix.install-phpunit-12
124+
run: composer require --dev friendsofphp/php-cs-fixer:dev-master phpunit/phpunit:^12.0.2 --no-update
125+
119126
- run: composer update --no-progress --classmap-authoritative ${{ matrix.composer-flags }}
120127

128+
- if: matrix.install-phpunit-12
129+
run: ./vendor/bin/php-cs-fixer fix --quiet --rules=php_unit_attributes
130+
121131
- run: composer show | grep php-cs-fixer
122132

123133
- run: ./vendor/bin/phpunit ${{ matrix.phpunit-flags }}
124134
env:
125135
FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}
126136

127-
- if: ${{ matrix.calculate-coverage }}
137+
- if: matrix.calculate-coverage
128138
env:
129139
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130140
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
131141
run: ./vendor/bin/php-coveralls --verbose
132142

133-
- if: ${{ matrix.calculate-coverage }}
143+
- if: matrix.calculate-coverage
134144
env:
135145
FAST_LINT_TEST_CASES: 1
136146
run: composer infection

0 commit comments

Comments
 (0)