@@ -5,7 +5,7 @@ on: # yamllint disable-line rule:truthy
5
5
inputs :
6
6
php-versions :
7
7
description : " The PHP versions to use when running the job"
8
- default : " ['7.4', '8.0', '8.1', '8.2', '8.3'] "
8
+ default : " auto-detect "
9
9
required : false
10
10
type : " string"
11
11
php-extensions :
@@ -29,14 +29,42 @@ on: # yamllint disable-line rule:truthy
29
29
type : " string"
30
30
31
31
jobs :
32
+ supported-versions-matrix :
33
+ name : " Supported Versions Matrix"
34
+ runs-on : " ubuntu-latest"
35
+ outputs :
36
+ extensions : " ${{ steps.supported-versions-matrix.outputs.extensions }}"
37
+ version : " ${{ steps.supported-versions-matrix.outputs.version }}"
38
+ steps :
39
+ - uses : " actions/checkout@v4"
40
+ if : " ${{ inputs.php-versions == 'auto-detect' }}"
41
+
42
+ - id : " supported-versions-detect"
43
+ if : " ${{ inputs.php-versions == 'auto-detect' }}"
44
+ uses : " WyriHaximus/github-action-composer-php-versions-in-range@v1"
45
+
46
+
47
+ - name : " Set PHP versions"
48
+ with :
49
+ inputVersions : " ${{ inputs.php-versions }}"
50
+ inputExtensions : " ${{ inputs.php-extensions }}"
51
+ detectedVersions : " ${{ steps.supported-versions-detect.outputs.versions }}"
52
+ detectedExtensions : " ${{ join(fromJson(steps.supported-versions-detect.outputs.version), ',') }}"
53
+
54
+ id : " supported-versions-matrix"
55
+ run : |
56
+ echo "version=[[ $inputVersions != "auto-detect" ]] $detected-versions || $inputVersions " >> $GITHUB_ENV
57
+ echo "extensions=[[ $inputVersions != "auto-detect" ]] $detectedExtensions || $inputExtensions " >> $GITHUB_ENV
58
+
32
59
tests :
33
60
name : " Tests"
34
61
35
62
runs-on : " ubuntu-latest"
36
63
64
+ needs : " supported-versions-matrix"
37
65
strategy :
38
66
matrix :
39
- php-version : " ${{ fromJson(inputs.php -versions) }}"
67
+ php-version : " ${{ fromJson(needs.supported -versions-matrix.outputs.version ) }}"
40
68
dependencies :
41
69
- " lowest"
42
70
- " locked"
0 commit comments