name: Build and Test on: push: branches: - main pull_request: branches: - main jobs: build-and-test: runs-on: ubuntu-slim steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/setup-go@v6 with: go-version: "1.26" - name: Cache Go modules id: cache-go uses: actions/cache@v5 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Download Go modules shell: bash if: ${{ steps.cache-go.outputs.cache-hit != 'true' }} run: go mod download - name: Go build shell: bash run: go build ./... - name: Go test shell: bash run: go test ./...