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