-
Notifications
You must be signed in to change notification settings - Fork 67
40 lines (38 loc) · 1.07 KB
/
go-ci.yml
File metadata and controls
40 lines (38 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Go CI
on:
workflow_dispatch:
push:
jobs:
go-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Go version from mise
id: mise
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Go
uses: sourcegraph/actions/go-setup@main
with:
go-version: ${{ steps.mise.outputs.go-version }}
- run: |
go test -race -v ./...
go test -v ./...
# This job provides a stable name for branch protection rules
# It will only pass if all Go CI matrix tests above pass
go-test-complete:
runs-on: ubuntu-latest
needs: go-test
if: always()
steps:
- name: Check Go CI results
run: |
if [[ "${{ needs.go-test.result }}" != "success" ]]; then
echo "One or more Go CI tests failed"
exit 1
fi
echo "All Go CI tests passed"