File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,29 @@ permissions:
1212 contents : read
1313
1414jobs :
15+ supportedVersions :
16+ name : Fetch supported Go versions
17+ runs-on : ubuntu-latest
18+ outputs :
19+ supported_versions : ${{ steps.matrix.outputs.supported_versions }}
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+ - name : Read supported_go_versions.txt
24+ id : matrix
25+ run : |
26+ versions=$(cat supported_go_versions.txt)
27+ matrix="[$(echo "$versions" | sed 's/\(.*\)/"\1"/' | paste -s -d,)]"
28+ echo "supported_versions=$matrix" >> $GITHUB_OUTPUT
29+
1530 test :
1631 name : Tests
1732 runs-on : ubuntu-latest
33+ needs : supportedVersions
1834
1935 strategy :
2036 matrix :
21- go_version : ["1.20", "1.21", "1.22"]
37+ go_version : ${{ fromJSON(needs.supportedVersions.outputs.supported_versions) }}
2238
2339 steps :
2440 - name : Checkout code
You can’t perform that action at this time.
0 commit comments