| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 1 | name: go_tests |
| 2 | on: |
| 3 | workflow_call: |
| 4 | push: |
| 5 | branches-ignore: |
| 6 | - "queue-main-**" |
| 7 | pull_request: |
| 8 | jobs: |
| 9 | test: |
| Sean McCullough | 9abbf92 | 2025-04-18 13:17:38 -0700 | [diff] [blame] | 10 | runs-on: "ubuntu-latest" |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 11 | 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 |
| 31 | |
| 32 | - name: Go generate |
| 33 | run: | |
| 34 | go generate ./... |
| 35 | |
| 36 | - name: Run tests |
| 37 | run: | |
| 38 | go test -v ./... |
| 39 | go test -v -race ./... |