Skip to content

Commit b141834

Browse files
Merge branch '5.1'
* 5.1: Update Psalm baseline Sync with CI pipeline configuration for PHPUnit Update tools
2 parents 43ce4a5 + 18a3d4f commit b141834

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2035
-378
lines changed

.github/workflows/ci.yml

Lines changed: 111 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ name: CI
88

99
env:
1010
COMPOSER_ROOT_VERSION: 6.0.x-dev
11+
PHP_VERSION: 8.4
1112

1213
permissions:
1314
contents: read
@@ -17,16 +18,29 @@ jobs:
1718
name: Coding Guidelines
1819

1920
runs-on: ubuntu-latest
21+
timeout-minutes: 5
2022

2123
steps:
2224
- name: Checkout
23-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 1
28+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
29+
30+
- name: Use local branch
31+
shell: bash
32+
run: |
33+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
34+
git branch -D $BRANCH 2>/dev/null || true
35+
git branch $BRANCH HEAD
36+
git checkout $BRANCH
2437
2538
- name: Install PHP
2639
uses: shivammathur/setup-php@v2
2740
with:
28-
php-version: 8.3
41+
php-version: ${{ env.PHP_VERSION }}
2942
coverage: none
43+
tools: none
3044

3145
- name: Run PHP-CS-Fixer
3246
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
@@ -35,16 +49,29 @@ jobs:
3549
name: Static Analysis
3650

3751
runs-on: ubuntu-latest
52+
timeout-minutes: 5
3853

3954
steps:
4055
- name: Checkout
41-
uses: actions/checkout@v4
56+
uses: actions/checkout@v5
57+
with:
58+
fetch-depth: 1
59+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
60+
61+
- name: Use local branch
62+
shell: bash
63+
run: |
64+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
65+
git branch -D $BRANCH 2>/dev/null || true
66+
git branch $BRANCH HEAD
67+
git checkout $BRANCH
4268
4369
- name: Install PHP
4470
uses: shivammathur/setup-php@v2
4571
with:
46-
php-version: 8.3
72+
php-version: ${{ env.PHP_VERSION }}
4773
coverage: none
74+
tools: none
4875

4976
- name: Install dependencies with Composer
5077
run: ./tools/composer update --no-interaction --no-ansi --no-progress
@@ -56,6 +83,7 @@ jobs:
5683
name: Tests
5784

5885
runs-on: ubuntu-latest
86+
timeout-minutes: 5
5987

6088
strategy:
6189
fail-fast: false
@@ -64,22 +92,98 @@ jobs:
6492
- 8.3
6593
- 8.4
6694
- 8.5
95+
- 8.6
6796

6897
steps:
6998
- name: Checkout
70-
uses: actions/checkout@v4
99+
uses: actions/checkout@v5
100+
with:
101+
fetch-depth: 1
102+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
103+
104+
- name: Use local branch
105+
shell: bash
106+
run: |
107+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
108+
git branch -D $BRANCH 2>/dev/null || true
109+
git branch $BRANCH HEAD
110+
git checkout $BRANCH
71111
72112
- name: Install PHP with extensions
73113
uses: shivammathur/setup-php@v2
74114
with:
75115
php-version: ${{ matrix.php-version }}
76-
coverage: xdebug
116+
coverage: none
117+
tools: none
118+
119+
- name: Get Composer cache directory
120+
id: composer-cache
121+
shell: bash
122+
run: |
123+
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
124+
125+
- name: Cache Composer cache directory
126+
uses: actions/cache@v4
127+
with:
128+
path: ${{ steps.composer-cache.outputs.dir }}
129+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
130+
restore-keys: ${{ runner.os }}-composer-
77131

78132
- name: Install dependencies with Composer
79133
run: ./tools/composer update --no-ansi --no-interaction --no-progress
80134

81135
- name: Run tests with PHPUnit
82-
run: ./vendor/bin/phpunit --log-junit test-results.xml --coverage-clover=code-coverage.xml
136+
run: vendor/bin/phpunit
137+
138+
code-coverage:
139+
name: Code Coverage
140+
141+
needs:
142+
- tests
143+
144+
runs-on: ubuntu-latest
145+
timeout-minutes: 5
146+
147+
steps:
148+
- name: Checkout
149+
uses: actions/checkout@v5
150+
with:
151+
fetch-depth: 1
152+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
153+
154+
- name: Use local branch
155+
shell: bash
156+
run: |
157+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
158+
git branch -D $BRANCH 2>/dev/null || true
159+
git branch $BRANCH HEAD
160+
git checkout $BRANCH
161+
162+
- name: Install PHP with extensions
163+
uses: shivammathur/setup-php@v2
164+
with:
165+
php-version: ${{ matrix.php-version }}
166+
coverage: xdebug
167+
tools: none
168+
169+
- name: Get Composer cache directory
170+
id: composer-cache
171+
shell: bash
172+
run: |
173+
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
174+
175+
- name: Cache Composer cache directory
176+
uses: actions/cache@v4
177+
with:
178+
path: ${{ steps.composer-cache.outputs.dir }}
179+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
180+
restore-keys: ${{ runner.os }}-composer-
181+
182+
- name: Install dependencies with Composer
183+
run: ./tools/composer update --no-ansi --no-interaction --no-progress
184+
185+
- name: Collect code coverage with PHPUnit
186+
run: vendor/bin/phpunit --log-junit test-results.xml --coverage-openclover=code-coverage.xml
83187

84188
- name: Upload test results to Codecov.io
85189
if: ${{ !cancelled() }}

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.64" installed="3.72.0" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="composer" version="^2.8" installed="2.8.6" location="./tools/composer" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.64" installed="3.88.0" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="composer" version="^2.8" installed="2.8.12" location="./tools/composer" copy="true"/>
55
</phive>

tools/.phpstan/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"require-dev": {
3-
"phpstan/phpstan": "^2.1.8",
3+
"phpstan/phpstan": "^2.1.29",
44
"phpstan/extension-installer": "^1.4.3",
5-
"phpstan/phpstan-strict-rules": "^2.0.3",
5+
"phpstan/phpstan-strict-rules": "^2.0.7",
66
"tomasvotruba/type-coverage": "^2.0.2",
7-
"ergebnis/phpstan-rules": "^2.8.0"
7+
"ergebnis/phpstan-rules": "^2.12.0"
88
},
99
"config": {
1010
"allow-plugins": {

tools/.phpstan/composer.lock

Lines changed: 41 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)