Skip to content

Commit c46078b

Browse files
Merge branch '10.1' into 11.0
* 10.1: Also upload test results to codecov.io Cache Composer's cache directory Do not fetch tags Introduce PHP_VERSION variable Test with PHP 8.5 Remove superfluous double-quotes Update tools
2 parents fefc2a8 + 084db8a commit c46078b

File tree

5 files changed

+81
-17
lines changed

5 files changed

+81
-17
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
name: CI
88

99
env:
10-
COMPOSER_ROOT_VERSION: "11.0.x-dev"
10+
COMPOSER_ROOT_VERSION: 11.0.x-dev
11+
PHP_VERSION: 8.4
1112

1213
jobs:
1314
coding-guidelines:
@@ -17,12 +18,23 @@ jobs:
1718

1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 1
24+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
25+
26+
- name: Use local branch
27+
shell: bash
28+
run: |
29+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
30+
git branch -D $BRANCH 2>/dev/null || true
31+
git branch $BRANCH HEAD
32+
git checkout $BRANCH
2133
2234
- name: Install PHP
2335
uses: shivammathur/setup-php@v2
2436
with:
25-
php-version: 8.3
37+
php-version: ${{ env.PHP_VERSION }}
2638
extensions: none, iconv, json, phar, tokenizer
2739
coverage: none
2840
tools: none
@@ -37,17 +49,41 @@ jobs:
3749

3850
steps:
3951
- name: Checkout
40-
uses: actions/checkout@v4
52+
uses: actions/checkout@v5
53+
with:
54+
fetch-depth: 1
55+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
56+
57+
- name: Use local branch
58+
shell: bash
59+
run: |
60+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
61+
git branch -D $BRANCH 2>/dev/null || true
62+
git branch $BRANCH HEAD
63+
git checkout $BRANCH
4164
4265
- name: Install PHP
4366
uses: shivammathur/setup-php@v2
4467
with:
45-
php-version: 8.4
68+
php-version: ${{ env.PHP_VERSION }}
4669
extensions: none, ctype, curl, dom, iconv, mbstring, opcache, simplexml, tokenizer, xml, xmlwriter
4770
coverage: none
4871
tools: none
4972

50-
- name: Install dependencies with Composer
73+
- name: Get Composer cache directory
74+
id: composer-cache
75+
shell: bash
76+
run: |
77+
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
78+
79+
- name: Cache Composer cache directory
80+
uses: actions/cache@v4
81+
with:
82+
path: ${{ steps.composer-cache.outputs.dir }}
83+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
84+
restore-keys: ${{ runner.os }}-composer-
85+
86+
- name: Update dependencies with composer
5187
run: ./tools/composer update --no-interaction --no-ansi --no-progress
5288

5389
- name: Run PHPStan
@@ -70,22 +106,33 @@ jobs:
70106
- windows-latest
71107

72108
php-version:
73-
- "8.2"
74-
- "8.3"
75-
- "8.4"
76-
- "8.5"
109+
- 8.2
110+
- 8.3
111+
- 8.4
112+
- 8.5
77113

78114
coverage-driver:
79-
- "pcov"
80-
- "xdebug3"
115+
- pcov
116+
- xdebug3
81117

82118
steps:
83119
- name: Configure Git to avoid issues with line endings
84120
if: matrix.os == 'windows-latest'
85121
run: git config --global core.autocrlf false
86122

87123
- name: Checkout
88-
uses: actions/checkout@v4
124+
uses: actions/checkout@v5
125+
with:
126+
fetch-depth: 1
127+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
128+
129+
- name: Use local branch
130+
shell: bash
131+
run: |
132+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
133+
git branch -D $BRANCH 2>/dev/null || true
134+
git branch $BRANCH HEAD
135+
git checkout $BRANCH
89136
90137
- name: Install PHP with extensions
91138
uses: shivammathur/setup-php@v2
@@ -96,19 +143,36 @@ jobs:
96143
ini-values: ${{ env.PHP_INI_VALUES }}
97144
tools: none
98145

146+
- name: Get Composer cache directory
147+
id: composer-cache
148+
shell: bash
149+
run: |
150+
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
151+
152+
- name: Cache Composer cache directory
153+
uses: actions/cache@v4
154+
with:
155+
path: ${{ steps.composer-cache.outputs.dir }}
156+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
157+
restore-keys: ${{ runner.os }}-composer-
158+
99159
- name: Install dependencies with Composer
100160
run: php ./tools/composer update --no-ansi --no-interaction --no-progress
101161

102162
- name: Run tests with PHPUnit
103-
run: vendor/bin/phpunit --log-junit junit.xml --coverage-clover=coverage.xml
163+
run: vendor/bin/phpunit --log-junit test-results.xml --coverage-clover=code-coverage.xml
104164

105165
- name: Upload test results to Codecov.io
106166
if: ${{ !cancelled() }}
107167
uses: codecov/test-results-action@v1
108168
with:
109169
token: ${{ secrets.CODECOV_TOKEN }}
170+
disable_search: true
171+
files: ./test-results.xml
110172

111173
- name: Upload code coverage data to Codecov.io
112174
uses: codecov/codecov-action@v4
113175
with:
114176
token: ${{ secrets.CODECOV_TOKEN }}
177+
disable_search: true
178+
files: ./code-coverage.xml

.phive/phars.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.86" installed="3.86.0" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="composer" version="^2.8" installed="2.8.11" location="./tools/composer" copy="true"/>
5-
<phar name="phpstan" version="^2.1" installed="2.1.22" location="./tools/phpstan" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.86" 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"/>
5+
<phar name="phpstan" version="^2.1" installed="2.1.29" location="./tools/phpstan" copy="true"/>
66
</phive>

tools/composer

964 Bytes
Binary file not shown.

tools/php-cs-fixer

148 KB
Binary file not shown.

tools/phpstan

227 KB
Binary file not shown.

0 commit comments

Comments
 (0)