Skip to content

Commit 82a132e

Browse files
author
Greg Bowler
committed
ci: update to new ci workflow
1 parent 907b3a4 commit 82a132e

File tree

1 file changed

+29
-39
lines changed

1 file changed

+29
-39
lines changed

.github/workflows/ci.yml

+29-39
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: [ 8.0, 8.1, 8.2 ]
10+
php: [ 8.1, 8.2, 8.3 ]
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

1515
- name: Cache Composer dependencies
1616
uses: actions/cache@v3
1717
with:
1818
path: /tmp/composer-cache
19-
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
19+
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
2020

2121
- name: Composer install
2222
uses: php-actions/composer@v6
@@ -27,25 +27,25 @@ jobs:
2727
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
2828

2929
- name: Upload build archive for test runners
30-
uses: actions/upload-artifact@v3
30+
uses: actions/upload-artifact@v4
3131
with:
32-
name: build-artifact
32+
name: build-artifact-${{ matrix.php }}
3333
path: /tmp/github-actions
3434

3535
phpunit:
3636
runs-on: ubuntu-latest
3737
needs: [ composer ]
3838
strategy:
3939
matrix:
40-
php: [ 8.0, 8.1, 8.2 ]
40+
php: [ 8.1, 8.2, 8.3 ]
4141

4242
outputs:
4343
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
4444

4545
steps:
46-
- uses: actions/download-artifact@v3
46+
- uses: actions/download-artifact@v4
4747
with:
48-
name: build-artifact
48+
name: build-artifact-${{ matrix.php }}
4949
path: /tmp/github-actions
5050

5151
- name: Extract build archive
@@ -56,46 +56,50 @@ jobs:
5656
env:
5757
XDEBUG_MODE: cover
5858
with:
59+
version: 10
5960
php_version: ${{ matrix.php }}
6061
php_extensions: xdebug
6162
coverage_text: _coverage/coverage.txt
6263
coverage_clover: _coverage/clover.xml
6364

6465
- name: Store coverage data
65-
uses: actions/upload-artifact@v3
66+
uses: actions/upload-artifact@v4
6667
with:
67-
name: code-coverage
68+
name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
6869
path: _coverage
6970

7071
coverage:
7172
runs-on: ubuntu-latest
7273
needs: [ phpunit ]
74+
strategy:
75+
matrix:
76+
php: [ 8.1, 8.2, 8.3 ]
7377

7478
steps:
75-
- uses: actions/checkout@v3
76-
77-
- uses: actions/download-artifact@v3
79+
- uses: actions/download-artifact@v4
7880
with:
79-
name: code-coverage
81+
name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
8082
path: _coverage
8183

8284
- name: Output coverage
8385
run: cat "_coverage/coverage.txt"
8486

8587
- name: Upload to Codecov
86-
uses: codecov/codecov-action@v3
88+
uses: codecov/codecov-action@v4
89+
with:
90+
token: ${{ secrets.CODECOV_TOKEN }}
8791

8892
phpstan:
8993
runs-on: ubuntu-latest
9094
needs: [ composer ]
9195
strategy:
9296
matrix:
93-
php: [ 8.0, 8.1, 8.2 ]
97+
php: [ 8.1, 8.2, 8.3 ]
9498

9599
steps:
96-
- uses: actions/download-artifact@v3
100+
- uses: actions/download-artifact@v4
97101
with:
98-
name: build-artifact
102+
name: build-artifact-${{ matrix.php }}
99103
path: /tmp/github-actions
100104

101105
- name: Extract build archive
@@ -106,18 +110,19 @@ jobs:
106110
with:
107111
php_version: ${{ matrix.php }}
108112
path: src/
113+
level: 6
109114

110115
phpmd:
111116
runs-on: ubuntu-latest
112117
needs: [ composer ]
113118
strategy:
114119
matrix:
115-
php: [ 8.0, 8.1, 8.2 ]
120+
php: [ 8.1, 8.2, 8.3 ]
116121

117122
steps:
118-
- uses: actions/download-artifact@v3
123+
- uses: actions/download-artifact@v4
119124
with:
120-
name: build-artifact
125+
name: build-artifact-${{ matrix.php }}
121126
path: /tmp/github-actions
122127

123128
- name: Extract build archive
@@ -136,12 +141,12 @@ jobs:
136141
needs: [ composer ]
137142
strategy:
138143
matrix:
139-
php: [ 8.0, 8.1, 8.2 ]
144+
php: [ 8.1, 8.2, 8.3 ]
140145

141146
steps:
142-
- uses: actions/download-artifact@v3
147+
- uses: actions/download-artifact@v4
143148
with:
144-
name: build-artifact
149+
name: build-artifact-${{ matrix.php }}
145150
path: /tmp/github-actions
146151

147152
- name: Extract build archive
@@ -153,18 +158,3 @@ jobs:
153158
php_version: ${{ matrix.php }}
154159
path: src/
155160
standard: phpcs.xml
156-
157-
remove_old_artifacts:
158-
runs-on: ubuntu-latest
159-
160-
steps:
161-
- name: Remove old artifacts for prior workflow runs on this repository
162-
env:
163-
GH_TOKEN: ${{ github.token }}
164-
run: |
165-
gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
166-
while read id
167-
do
168-
echo -n "Deleting artifact ID $id ... "
169-
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
170-
done <artifact-id-list.txt

0 commit comments

Comments
 (0)