| name: go_tests |
| on: |
| workflow_call: |
| push: |
| branches-ignore: |
| - "queue-main-**" |
| pull_request: |
| jobs: |
| test: |
| runs-on: "ubuntu-latest" |
| steps: |
| - uses: actions/checkout@master |
| |
| - uses: actions/setup-go@v5 |
| with: |
| go-version-file: "go.mod" |
| cache: true |
| |
| - name: Cache Go 1.24.2 |
| uses: actions/cache@v4 |
| with: |
| path: | |
| ~/.cache/go-build |
| key: ${{ runner.os }}-go1.24.2-${{ hashFiles('**/go.sum') }} |
| restore-keys: | |
| ${{ runner.os }}-go1.24.2- |
| |
| - name: Install tools |
| run: | |
| go install golang.org/x/tools/gopls@latest |
| go install gotest.tools/gotestsum@latest |
| go install mvdan.cc/gofumpt@latest |
| go install golang.org/x/tools/cmd/goimports@latest |
| |
| - name: Go generate |
| run: | |
| go generate ./... |
| |
| - name: Run tests |
| run: | |
| gotestsum --format testname -- ./... |
| gotestsum --format testname -- -race ./... |