Skip to content

Commit

Permalink
Go: put back go setup
Browse files Browse the repository at this point in the history
  • Loading branch information
redsun82 committed Apr 26, 2024
1 parent 0f387ee commit 86d6b8e
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:
- .github/actions/**
- codeql-workspace.yml

env:
GO_VERSION: '~1.22.0'

permissions:
contents: read

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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 }}"

0 comments on commit 86d6b8e

Please sign in to comment.