Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Remove hardcoded supported Go versions from go.yml #1489

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,29 @@ permissions:
contents: read

jobs:
supportedVersions:
name: Fetch supported Go versions
runs-on: ubuntu-latest
outputs:
supported_versions: ${{ steps.matrix.outputs.supported_versions }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read supported_go_versions.txt
id: matrix
run: |
versions=$(head -n 3 supported_go_versions.txt)
SachinSahu431 marked this conversation as resolved.
Show resolved Hide resolved
matrix="[$(echo "$versions" | sed 's/\(.*\)/"\1"/' | paste -s -d,)]"
echo "supported_versions=$matrix" >> $GITHUB_OUTPUT

test:
name: Tests
runs-on: ubuntu-latest
needs: supportedVersions

strategy:
matrix:
go_version: ["1.20", "1.21", "1.22"]
go_version: ${{ fromJSON(needs.supportedVersions.outputs.supported_versions) }}

steps:
- name: Checkout code
Expand Down