Skip to content

Commit 684ebfd

Browse files
committedAug 23, 2024
Update CI
1 parent 986a689 commit 684ebfd

File tree

5 files changed

+53
-67
lines changed

5 files changed

+53
-67
lines changed
 

‎.github/workflows/continuous-integration.yml

+24-31
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9-
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
10-
117
permissions:
128
contents: read
139

1410
jobs:
1511
tests:
1612
name: "CI"
1713

18-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
15+
continue-on-error: ${{ matrix.experimental }}
1916

2017
strategy:
2118
matrix:
@@ -25,41 +22,37 @@ jobs:
2522
- "7.4"
2623
- "8.0"
2724
- "8.1"
28-
dependencies: [locked]
25+
- "8.2"
26+
- "8.3"
27+
- "8.4"
28+
dependencies: [highest]
29+
experimental: [false]
30+
os: [ubuntu-latest]
2931
include:
3032
- php-version: "7.2"
3133
dependencies: lowest
32-
- php-version: "8.1"
34+
os: ubuntu-latest
35+
experimental: false
36+
- php-version: "8.3"
3337
dependencies: lowest
38+
os: ubuntu-latest
39+
experimental: false
40+
- php-version: "8.3"
41+
dependencies: highest
42+
os: windows-latest
43+
experimental: false
3444

3545
steps:
36-
- name: "Checkout"
37-
uses: "actions/checkout@v4"
46+
- uses: actions/checkout@v4
3847

39-
- name: "Install PHP"
40-
uses: "shivammathur/setup-php@v2"
48+
- uses: shivammathur/setup-php@v2
4149
with:
42-
coverage: "none"
4350
php-version: "${{ matrix.php-version }}"
44-
tools: composer:snapshot
45-
46-
- name: Get composer cache directory
47-
id: composercache
48-
run: "echo \"dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
51+
coverage: none
4952

50-
- name: Cache dependencies
51-
uses: actions/cache@v2
53+
- uses: ramsey/composer-install@v3
5254
with:
53-
path: ${{ steps.composercache.outputs.dir }}
54-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
55-
restore-keys: ${{ runner.os }}-composer-
56-
57-
- name: "Handle lowest dependencies update"
58-
if: "contains(matrix.dependencies, 'lowest')"
59-
run: "echo \"COMPOSER_FLAGS=$COMPOSER_FLAGS --prefer-lowest\" >> $GITHUB_ENV"
60-
61-
- name: "Install latest dependencies"
62-
run: "composer update ${{ env.COMPOSER_FLAGS }}"
55+
dependency-versions: ${{ matrix.dependencies }}
6356

64-
- name: "Run tests"
65-
run: "vendor/bin/simple-phpunit --verbose"
57+
- name: Run tests
58+
run: composer test

‎.github/workflows/lint.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,27 @@ jobs:
1717
matrix:
1818
php-version:
1919
- "7.2"
20-
- "latest"
20+
- "nightly"
2121

2222
steps:
23-
- name: "Checkout"
24-
uses: "actions/checkout@v4"
23+
- uses: actions/checkout@v4
2524

26-
- name: "Install PHP"
27-
uses: "shivammathur/setup-php@v2"
25+
- uses: shivammathur/setup-php@v2
2826
with:
29-
coverage: "none"
3027
php-version: "${{ matrix.php-version }}"
28+
coverage: none
3129

3230
- name: "Lint PHP files"
33-
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
31+
run: |
32+
hasErrors=0
33+
for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
34+
do
35+
{ error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
36+
if [ "$error" != "" ]; then
37+
while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
38+
hasErrors=1
39+
fi
40+
done
41+
if [ $hasErrors -eq 1 ]; then
42+
exit 1
43+
fi

‎.github/workflows/phpstan.yml

+8-25
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9-
SYMFONY_PHPUNIT_VERSION: ""
10-
117
permissions:
128
contents: read
139

@@ -20,33 +16,20 @@ jobs:
2016
strategy:
2117
matrix:
2218
php-version:
23-
- "8.0"
19+
- "7.2"
20+
- "8.3"
2421

2522
steps:
26-
- name: "Checkout"
27-
uses: "actions/checkout@v4"
23+
- uses: actions/checkout@v4
2824

29-
- name: "Install PHP"
30-
uses: "shivammathur/setup-php@v2"
25+
- uses: shivammathur/setup-php@v2
3126
with:
32-
coverage: "none"
3327
php-version: "${{ matrix.php-version }}"
28+
coverage: none
3429

35-
- name: Get composer cache directory
36-
id: composercache
37-
run: "echo \"dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
38-
39-
- name: Cache dependencies
40-
uses: actions/cache@v2
30+
- uses: ramsey/composer-install@v3
4131
with:
42-
path: ${{ steps.composercache.outputs.dir }}
43-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
44-
restore-keys: ${{ runner.os }}-composer-
45-
46-
- name: "Install latest dependencies"
47-
run: "composer update ${{ env.COMPOSER_FLAGS }}"
32+
dependency-versions: highest
4833

4934
- name: Run PHPStan
50-
run: |
51-
composer require --dev phpunit/phpunit:^8.5.18 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
52-
vendor/bin/phpstan analyse
35+
run: composer phpstan

‎composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@
105105
"require-dev": {
106106
"composer/composer": "^1.10.27 || ^2.7",
107107
"composer/semver": "^1.7.2 || ^3.4.0",
108-
"symfony/phpunit-bridge": "^7.1.1",
108+
"phpunit/phpunit": "^8 || ^9",
109109
"phpstan/phpstan": "^1.11",
110110
"symfony/process": "^5 || ^6 || ^7",
111111
"phpstan/phpstan-phpunit": "^1"
112112
},
113113
"scripts": {
114-
"test": "@php vendor/bin/simple-phpunit",
115-
"phpstan": "@php vendor/bin/phpstan analyse"
114+
"test": "@php phpunit",
115+
"phpstan": "@php phpstan analyse"
116116
}
117117
}

‎phpstan.neon.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
paths:
44
- src
55
- tests
6-
excludes_analyse:
6+
excludePaths:
77
- tests/Composer/Installers/Test/PolyfillTestCase.php
88
ignoreErrors:
99
- '~Test::[a-zA-Z0-9]+Provider\(\) return type~'

0 commit comments

Comments
 (0)