name: Build and Test on: push: branches: - main pull_request: branches: - main jobs: build-and-test: runs-on: ubuntu-slim steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - uses: actions/setup-go@v5 with: go-version: "1.26" - name: Cache Go modules id: cache-go uses: actions/cache@v4 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 ./...