Go: put back go setup

This commit is contained in:
Paolo Tranquilli
2024-04-26 16:39:51 +02:00
parent 0f387eeac2
commit 86d6b8ef21

View File

@@ -16,9 +16,6 @@ on:
- .github/actions/**
- codeql-workspace.yml
env:
GO_VERSION: '~1.22.0'
permissions:
contents: read
@@ -31,6 +28,21 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Get go version
shell: bash
run: |
(
echo -n "GO_VERSION="
bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/'
) | tee -a "$GITHUB_ENV"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
id: go
- name: Set up CodeQL CLI
uses: ./.github/actions/fetch-codeql
@@ -42,24 +54,6 @@ jobs:
run: |
bazel run //go:create-extractor-pack
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: go-qltest
- name: Test
run: |
cd go
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
check-code:
name: Check code
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check that all Go code is autoformatted
run: |
cd go
@@ -84,3 +78,14 @@ jobs:
with:
name: qhelp-markdown
path: go/qhelp-out/**/*.md
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: go-qltest
- name: Test
run: |
cd go
make test cache="${{ steps.query-cache.outputs.cache-dir }}"