Go: specify Go runtime version in actions

This commit is contained in:
Paolo Tranquilli
2024-05-06 14:42:05 +02:00
parent c123513311
commit e71d038d7f

View File

@@ -1,6 +1,10 @@
name: Test go extractor
description: Run build, QL tests and optionally basic code sanity checks (formatting and generation)
inputs:
go-version:
description: Which Go version to use for running the tests
required: false
default: ~1.22.0
run-code-checks:
description: Whether to run formatting, code and qhelp generation checks
required: false
@@ -8,18 +12,10 @@ inputs:
runs:
using: composite
steps:
- name: Get go version
shell: bash
run: |
(
echo -n "GO_VERSION="
bazel run @rules_go//go -- version | sed 's/go version go\(.*\) .*/\1/'
) | tee -a "$GITHUB_ENV"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: ${{ inputs.go-version }}
cache: false
id: go