Skip to content

Commit 8243bb8

Browse files
authored
Update GitHub actions (#633)
* use v3 checkout * add missing laravel 10 tests * adjust phpunit * phpunit config
1 parent a701b7a commit 8243bb8

File tree

5 files changed

+74
-32
lines changed

5 files changed

+74
-32
lines changed

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
repository: 'nunomaduro/phpinsights'
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
- name: Get Release version
2121
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
2222
if: ${{ env.publish == 'true' }}

.github/workflows/frameworks.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,23 @@ jobs:
8686
fail-fast: false
8787
matrix:
8888
os: [ubuntu-latest]
89-
version: ['^9.0', '^8.0']
89+
version: ['^10.0', '^9.0', '^8.0']
9090
php: ['7.4', '8.0', '8.1', '8.2']
9191
composer-version: [v2]
92+
include:
93+
- version: '^10.0'
94+
phpunit: '^10.0'
95+
- version: '^9.0'
96+
phpunit: '^9.0'
97+
- version: '^8.0'
98+
phpunit: '^9.0'
9299
exclude:
93100
- version: '^9.0'
94101
php: '7.4'
102+
- version: '^10.0'
103+
php: '7.4'
104+
- version: '^10.0'
105+
php: '8.0'
95106
name: "Laravel:${{ matrix.version }} - PHP${{ matrix.php }} - Composer ${{ matrix.composer-version }}"
96107

97108
steps:
@@ -127,9 +138,9 @@ jobs:
127138
composer config prefer-stable true
128139
composer config minimum-stability dev
129140
continue-on-error: ${{ env.allow_failure == 'true' }}
130-
- name: Require phpunit:^9
141+
- name: Require phpunit
131142
working-directory: ./project
132-
run: composer require --dev phpunit/phpunit:^9.0 --update-with-dependencies -n --ansi
143+
run: composer require --dev phpunit/phpunit:${{ matrix.phpunit }} --update-with-dependencies -n --ansi
133144
continue-on-error: ${{ env.allow_failure == 'true' }}
134145
- name: Allow plugin
135146
working-directory: ./project

.github/workflows/test.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ jobs:
1414
php: ['7.4', '8.0', '8.1', '8.2']
1515
dependency-version: [prefer-lowest, prefer-stable]
1616
composer-version: [ v2 ]
17+
include:
18+
- php: '8.2'
19+
phpunit: '^10.0'
20+
- php: '8.1'
21+
phpunit: '^10.0'
22+
- php: '8.0'
23+
phpunit: '^9.0'
24+
- php: '7.4'
25+
phpunit: '^9.0'
1726
exclude:
1827
- dependency-version: prefer-lowest
1928
php: '8.0'
@@ -43,5 +52,14 @@ jobs:
4352

4453
- name: Install Composer dependencies
4554
run: composer update --${{ matrix.dependency-version }} --ansi --no-interaction --prefer-dist
46-
- name: Unit Tests
55+
56+
- name: Force PHPUnit version
57+
run: composer require --dev phpunit/phpunit:${{ matrix.phpunit }} --update-with-dependencies -n --ansi
58+
59+
- name: Unit Tests via PHPUnit 9
60+
if: matrix.phpunit == '^9.0'
61+
run: vendor/bin/phpunit --color=always -c phpunit9.xml
62+
63+
- name: Unit Tests via PHPUnit 10
64+
if: matrix.phpunit == '^10.0'
4765
run: vendor/bin/phpunit --color=always

phpunit.xml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
beStrictAboutTestsThatDoNotTestAnything="true"
6-
beStrictAboutOutputDuringTests="true"
7-
bootstrap="vendor/squizlabs/php_codesniffer/tests/bootstrap.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
failOnRisky="true"
13-
failOnWarning="true"
14-
processIsolation="false"
15-
stopOnError="false"
16-
stopOnFailure="false"
17-
verbose="true"
18-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
19-
<coverage>
20-
<include>
21-
<directory suffix=".php">./src</directory>
22-
</include>
23-
</coverage>
24-
<testsuites>
25-
<testsuite name="Test Suite">
26-
<directory suffix="Test.php">./tests</directory>
27-
</testsuite>
28-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" bootstrap="vendor/squizlabs/php_codesniffer/tests/bootstrap.php" colors="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Test Suite">
10+
<directory suffix="Test.php">./tests</directory>
11+
</testsuite>
12+
</testsuites>
2913
</phpunit>

phpunit9.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
beStrictAboutTestsThatDoNotTestAnything="true"
6+
beStrictAboutOutputDuringTests="true"
7+
bootstrap="vendor/squizlabs/php_codesniffer/tests/bootstrap.php"
8+
colors="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
failOnRisky="true"
13+
failOnWarning="true"
14+
processIsolation="false"
15+
stopOnError="false"
16+
stopOnFailure="false"
17+
verbose="true"
18+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
19+
<coverage>
20+
<include>
21+
<directory suffix=".php">./src</directory>
22+
</include>
23+
</coverage>
24+
<testsuites>
25+
<testsuite name="Test Suite">
26+
<directory suffix="Test.php">./tests</directory>
27+
</testsuite>
28+
</testsuites>
29+
</phpunit>

0 commit comments

Comments
 (0)