Skip to content

Commit 1cbbd9e

Browse files
committed
chore: use recent php versions for tests
1 parent 5ebe968 commit 1cbbd9e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/php.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,28 @@ on:
77
branches: [ master, v2, v3 ]
88

99
jobs:
10+
get-php-versions:
11+
name: Get PHP versions
12+
runs-on: ubuntu-latest
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.matrix }}
15+
steps:
16+
- name: Fetch PHP versions
17+
id: set-matrix
18+
run: |
19+
response=$(curl -s https://php.watch/api/v1/versions/secure)
20+
versions=$(echo "$response" | jq -r '.data | [.[] | .name] | sort_by(. | split(".") | map(tonumber)) | @json')
21+
echo "matrix=$versions" >> $GITHUB_OUTPUT
22+
1023
build:
1124
runs-on: 'ubuntu-latest'
25+
needs: get-php-versions
1226
strategy:
1327
matrix:
14-
php-versions: [ '8.0', '8.1', '8.2' ]
28+
php-versions: ${{ fromJson(needs.get-php-versions.outputs.matrix) }}
1529

1630
steps:
17-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v5
1832

1933
- name: Setup PHP with PCOV
2034
uses: shivammathur/setup-php@v2

0 commit comments

Comments
 (0)