Skip to content

Commit da0791f

Browse files
authored
CI 2026 (#171)
* ci: upgrade test runners * tweak: remove unused ignore * feature: gt->GT closes #162 * ci: retention days * build: update dependencies * tweak: improve static analysis * tweak: merge Gt->GT changes * tweak: remove namespace aliases
1 parent d66149b commit da0791f

23 files changed

Lines changed: 154 additions & 160 deletions

.github/workflows/ci.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
46

57
permissions:
68
contents: read
79
actions: read
8-
id-token: none
910

1011
jobs:
1112
composer:
1213
runs-on: ubuntu-latest
1314
strategy:
1415
matrix:
15-
php: [ 8.4 ]
16+
php: [ 8.4, 8.5 ]
1617

1718
steps:
18-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
1920

2021
- name: Cache Composer dependencies
21-
uses: actions/cache@v4
22+
uses: actions/cache@v5
2223
with:
2324
path: /tmp/composer-cache
2425
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
@@ -27,6 +28,7 @@ jobs:
2728
uses: php-actions/composer@v6
2829
with:
2930
php_version: ${{ matrix.php }}
31+
php_extensions: pcntl
3032

3133
- name: Archive build
3234
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
@@ -36,13 +38,14 @@ jobs:
3638
with:
3739
name: build-artifact-${{ matrix.php }}
3840
path: /tmp/github-actions
41+
retention-days: 1
3942

4043
phpunit:
4144
runs-on: ubuntu-latest
4245
needs: [ composer ]
4346
strategy:
4447
matrix:
45-
php: [ 8.4 ]
48+
php: [ 8.4, 8.5 ]
4649

4750
outputs:
4851
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
@@ -71,13 +74,14 @@ jobs:
7174
with:
7275
name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
7376
path: _coverage
77+
retention-days: 1
7478

7579
coverage:
7680
runs-on: ubuntu-latest
7781
needs: [ phpunit ]
7882
strategy:
7983
matrix:
80-
php: [ 8.4 ]
84+
php: [ 8.4, 8.5 ]
8185

8286
steps:
8387
- uses: actions/checkout@v4
@@ -100,7 +104,7 @@ jobs:
100104
needs: [ composer ]
101105
strategy:
102106
matrix:
103-
php: [ 8.4 ]
107+
php: [ 8.4, 8.5 ]
104108

105109
steps:
106110
- uses: actions/download-artifact@v4
@@ -116,13 +120,15 @@ jobs:
116120
with:
117121
php_version: ${{ matrix.php }}
118122
path: src/
123+
level: 6
124+
memory_limit: 256M
119125

120126
phpmd:
121127
runs-on: ubuntu-latest
122128
needs: [ composer ]
123129
strategy:
124130
matrix:
125-
php: [ 8.4 ]
131+
php: [ 8.4, 8.5 ]
126132

127133
steps:
128134
- uses: actions/download-artifact@v4
@@ -146,7 +152,7 @@ jobs:
146152
needs: [ composer ]
147153
strategy:
148154
matrix:
149-
php: [ 8.4 ]
155+
php: [ 8.4, 8.5 ]
150156

151157
steps:
152158
- uses: actions/download-artifact@v4
@@ -163,21 +169,3 @@ jobs:
163169
php_version: ${{ matrix.php }}
164170
path: src/
165171
standard: phpcs.xml
166-
167-
remove_old_artifacts:
168-
runs-on: ubuntu-latest
169-
170-
permissions:
171-
actions: write
172-
173-
steps:
174-
- name: Remove old artifacts for prior workflow runs on this repository
175-
env:
176-
GH_TOKEN: ${{ github.token }}
177-
run: |
178-
gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
179-
while read id
180-
do
181-
echo -n "Deleting artifact ID $id ... "
182-
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
183-
done <artifact-id-list.txt

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/vendor
22
/test/unit/_coverage
3-
/.idea
3+
/.idea

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See also, the [JavaScript implementation][fetch-js] that ships as standard in al
2626

2727
```php
2828
<?php
29-
$http = new Gt\Fetch\Http();
29+
$http = new GT\Fetch\Http();
3030

3131
// Rather than creating the request now, `fetch` returns a Promise,
3232
// for later resolution with the BodyResponse.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525

2626
"autoload": {
2727
"psr-4": {
28+
"GT\\Fetch\\": "./src",
2829
"Gt\\Fetch\\": "./src"
2930
}
3031
},
3132

3233
"autoload-dev": {
3334
"psr-4": {
35+
"GT\\Fetch\\Test\\": "./test/phpunit",
3436
"Gt\\Fetch\\Test\\": "./test/phpunit"
3537
}
3638
},
@@ -44,7 +46,6 @@
4446

4547
"scripts": {
4648
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
47-
"phpunit:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text",
4849
"phpstan": "vendor/bin/phpstan analyse --level 6 src",
4950
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
5051
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",

0 commit comments

Comments
 (0)