diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c89b1655..2b13818a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,39 +15,73 @@ on: - 'docs/**' - 'examples/**' -jobs: +env: + GO_VERSION: '1.21' - audit: +jobs: + verify-dependencies: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - check-latest: true - - - name: Verify dependencies - run: go mod verify + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Verify dependencies + run: go mod verify - - name: Build - run: go build -v ./... - - - name: Run go vet - run: go vet ./... - - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest - - - name: Run staticcheck - run: staticcheck ./... + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Build + run: go build -v ./... - - name: Install golint - run: go install golang.org/x/lint/golint@latest + vet: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Run go vet + run: go vet ./... - - name: Run golint - run: golint ./... + staticcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + - name: Run staticcheck + run: staticcheck ./... - - name: Run tests - run: go test -race -vet=off ./... + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Run tests + run: go test -race -vet=off ./...