diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bfab1aa5..eadb89d3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,39 +6,88 @@ on: pull_request: branches: [master] -jobs: +env: + GO_VERSION: '1.21' - audit: +jobs: + verify-dependencies: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '1.19' - check-latest: true - - - name: Verify dependencies - run: go mod verify + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + 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 + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Build + run: go build -v ./... - - name: Run staticcheck - run: staticcheck ./... + vet: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Run go vet + run: go vet ./... - - name: Install golint - run: go install golang.org/x/lint/golint@latest + staticcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + 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 golint - run: golint ./... + golint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Install golint + run: go install golang.org/x/lint/golint@latest + - name: Run golint + run: golint ./... - - name: Run proxmox unit tests - run: go test -race -vet=off ./proxmox/... ./internal/... + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - name: Run proxmox unit tests + run: go test -race -vet=off ./proxmox/... ./internal/...