Skip to content

Commit d66494d

Browse files
committed
Go: update go-tests-other-os.yml
1 parent 86d6b8e commit d66494d

File tree

1 file changed

+15
-43
lines changed

1 file changed

+15
-43
lines changed

.github/workflows/go-tests-other-os.yml

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,38 @@ on:
77
- .github/workflows/go-tests-other-os.yml
88
- .github/actions/**
99
- codeql-workspace.yml
10-
env:
11-
GO_VERSION: '~1.22.0'
1210

1311
permissions:
1412
contents: read
1513

1614
jobs:
17-
test-mac:
18-
name: Test MacOS
19-
runs-on: macos-latest
15+
test:
16+
name: Test
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [macos-latest, windows-latest-xl]
21+
if: matrix.os == 'macos-latest' || github.repository_owner == 'github'
22+
runs-on: ${{ matrix.os }}
2023
steps:
21-
- name: Set up Go ${{ env.GO_VERSION }}
22-
uses: actions/setup-go@v5
23-
with:
24-
go-version: ${{ env.GO_VERSION }}
25-
cache: false
26-
id: go
27-
2824
- name: Check out code
2925
uses: actions/checkout@v4
3026

31-
- name: Set up CodeQL CLI
32-
uses: ./.github/actions/fetch-codeql
33-
34-
- name: Enable problem matchers in repository
27+
- name: Get go version
3528
shell: bash
36-
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
37-
38-
- name: Build
39-
run: |
40-
cd go
41-
make
42-
43-
- name: Cache compilation cache
44-
id: query-cache
45-
uses: ./.github/actions/cache-query-compilation
46-
with:
47-
key: go-qltest
48-
- name: Test
4929
run: |
50-
cd go
51-
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
30+
(
31+
echo -n "GO_VERSION="
32+
bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/'
33+
) | tee -a "$GITHUB_ENV"
5234
53-
test-win:
54-
if: github.repository_owner == 'github'
55-
name: Test Windows
56-
runs-on: windows-latest-xl
57-
steps:
58-
- name: Set up Go ${{ env.GO_VERSION }}
35+
- name: Set up Go
5936
uses: actions/setup-go@v5
6037
with:
6138
go-version: ${{ env.GO_VERSION }}
6239
cache: false
6340
id: go
6441

65-
- name: Check out code
66-
uses: actions/checkout@v4
67-
6842
- name: Set up CodeQL CLI
6943
uses: ./.github/actions/fetch-codeql
7044

@@ -74,15 +48,13 @@ jobs:
7448

7549
- name: Build
7650
run: |
77-
cd go
78-
make
51+
bazel run //go:create-extractor-pack
7952
8053
- name: Cache compilation cache
8154
id: query-cache
8255
uses: ./.github/actions/cache-query-compilation
8356
with:
8457
key: go-qltest
85-
8658
- name: Test
8759
run: |
8860
cd go

0 commit comments

Comments
 (0)