blob: 4d72733dedb1c5732d961991028b076e02c648f6 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001name: go_tests
2on:
3 workflow_call:
4 push:
5 branches-ignore:
Josh Bleecher Snyder93bb66a2025-04-30 16:29:05 -07006 - "queue-main-*"
7 - "queue-dev-*"
Earl Lee2e463fb2025-04-17 11:22:22 -07008 pull_request:
9jobs:
10 test:
Sean McCullough9abbf922025-04-18 13:17:38 -070011 runs-on: "ubuntu-latest"
Earl Lee2e463fb2025-04-17 11:22:22 -070012 steps:
13 - uses: actions/checkout@master
14
15 - uses: actions/setup-go@v5
16 with:
17 go-version-file: "go.mod"
18 cache: true
19
20 - name: Cache Go 1.24.2
21 uses: actions/cache@v4
22 with:
23 path: |
24 ~/.cache/go-build
25 key: ${{ runner.os }}-go1.24.2-${{ hashFiles('**/go.sum') }}
26 restore-keys: |
27 ${{ runner.os }}-go1.24.2-
28
29 - name: Install tools
30 run: |
31 go install golang.org/x/tools/gopls@latest
Philip Zeyliger6c1f34f2025-04-23 19:33:03 -070032 go install gotest.tools/gotestsum@latest
Josh Bleecher Snyder833a0f82025-04-24 18:39:36 +000033 go install mvdan.cc/gofumpt@latest
34 go install golang.org/x/tools/cmd/goimports@latest
Earl Lee2e463fb2025-04-17 11:22:22 -070035
36 - name: Go generate
37 run: |
38 go generate ./...
39
40 - name: Run tests
41 run: |
Philip Zeyliger6c1f34f2025-04-23 19:33:03 -070042 gotestsum --format testname -- ./...
43 gotestsum --format testname -- -race ./...