diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..271d8ed --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ "**" ] + pull_request: + +permissions: read-all + +jobs: + lint-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + + - name: Cache Go build + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + go-${{ runner.os }}- + + - name: Install golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + args: --version + + - name: Lint + run: golangci-lint run + + - name: Test + run: go test ./... -race -coverprofile=coverage.out