name: CI on: push: branches: [main] paths: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - '.github/workflows/**' - '!**.md' - '!docs/**' - '!LICENSE' pull_request: paths: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - '.github/workflows/**' - '!**.md' - '!docs/**' - '!LICENSE' jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v5 with: go-version: stable - name: Cache Go modules uses: actions/cache@v5 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-mod- - name: Run golangci-lint uses: golangci/golangci-lint-action@v9 with: version: v2.10.1 test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v5 with: go-version: stable - name: Cache Go modules uses: actions/cache@v5 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-mod- - name: Cache Go build cache uses: actions/cache@v5 with: path: ~/.cache/go-build key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-build- - name: Run tests run: go test -race -v ./...