Goodactor fixes #292
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| test: | |
| name: Test (Go ${{ matrix.go-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['1.25'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ matrix.go-version }}- | |
| - name: Ensure go tools / modules available | |
| run: | | |
| go env | |
| go version | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Check formatting (gofmt) | |
| run: | | |
| bad=$(gofmt -l .) | |
| if [ -n "$bad" ]; then | |
| echo "The following files need to be formatted with 'gofmt -w':" | |
| echo "$bad" | |
| exit 1 | |
| fi | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.6.1 | |
| - name: Run go vet | |
| env: | |
| GOFLAGS: -mod=mod | |
| run: go vet ./... | |
| - name: Run tests with race detector | |
| env: | |
| GOFLAGS: -mod=mod | |
| run: | | |
| go test -race ./... -v | |
| - name: Check for vulnerabilities | |
| run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./... |