From 48220354d48ce311bd0ad22ce3960a075abef49a Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:40:31 +0200 Subject: [PATCH 1/8] ci: run jobs in parralel --- .github/workflows/go.yml | 65 ++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bfab1aa5..3fab5d50 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,38 +7,59 @@ on: branches: [master] jobs: - - audit: + setup: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - name: Checkout code + 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: Build - run: go build -v ./... - - - name: Run go vet - run: go vet ./... + verify-dependencies: + runs-on: ubuntu-latest + needs: setup + steps: + - name: Verify dependencies + run: go mod verify - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest + build: + runs-on: ubuntu-latest + needs: setup + steps: + - name: Build + run: go build -v ./... - - name: Run staticcheck - run: staticcheck ./... + vet: + runs-on: ubuntu-latest + needs: setup + steps: + - name: Run go vet + run: go vet ./... - - name: Install golint - run: go install golang.org/x/lint/golint@latest + staticcheck: + runs-on: ubuntu-latest + needs: setup + steps: + - 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 + needs: setup + steps: + - 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 + needs: setup + steps: + - name: Run proxmox unit tests + run: go test -race -vet=off ./proxmox/... ./internal/... From 34c0796c593def6002e6898b1b56a36570ef8158 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:43:49 +0200 Subject: [PATCH 2/8] checkout before verify --- .github/workflows/go.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3fab5d50..73b9941e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,6 +22,8 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Verify dependencies run: go mod verify From ba94610dc0484d832b1cb17732358fb2eabe912e Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:25:29 +0200 Subject: [PATCH 3/8] add checkout --- .github/workflows/go.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 73b9941e..c7a8790a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -45,6 +45,8 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run staticcheck @@ -54,6 +56,8 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Install golint run: go install golang.org/x/lint/golint@latest - name: Run golint From aa61cd2179dcd4eace883762bae4c5165ec33c4c Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:26:40 +0200 Subject: [PATCH 4/8] add checkout --- .github/workflows/go.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c7a8790a..0ca28e4e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,6 +31,8 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Build run: go build -v ./... @@ -38,6 +40,8 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Run go vet run: go vet ./... @@ -67,5 +71,7 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Run proxmox unit tests run: go test -race -vet=off ./proxmox/... ./internal/... From ee59ea1b13967f86741c1e36666fa7a03af7e532 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:29:10 +0200 Subject: [PATCH 5/8] get go version --- .github/workflows/go.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0ca28e4e..a446e470 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -75,3 +75,10 @@ jobs: uses: actions/checkout@v2 - name: Run proxmox unit tests run: go test -race -vet=off ./proxmox/... ./internal/... + + version: + runs-on: ubuntu-latest + needs: setup + steps: + - name: Get Go version + run: go version \ No newline at end of file From d57d5b32a4b925fd50c10a82ce974409d0cfc280 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:31:51 +0200 Subject: [PATCH 6/8] install go for every step --- .github/workflows/go.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a446e470..60d4bc9d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [master] +env: + GO_VERSION: '1.19' + jobs: setup: runs-on: ubuntu-latest @@ -15,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: ${{ env.GO_VERSION }} check-latest: true verify-dependencies: @@ -24,6 +27,11 @@ jobs: 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: Verify dependencies run: go mod verify @@ -33,6 +41,11 @@ jobs: 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 ./... @@ -42,6 +55,11 @@ jobs: 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 ./... @@ -62,6 +80,11 @@ jobs: 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 @@ -73,6 +96,11 @@ jobs: 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/... @@ -80,5 +108,10 @@ jobs: runs-on: ubuntu-latest needs: setup steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Get Go version run: go version \ No newline at end of file From f5ade2f992572dadb8c49250f5bb35a86d717f74 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:37:10 +0200 Subject: [PATCH 7/8] fix --- .github/workflows/go.yml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 60d4bc9d..ef27dfbe 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,20 +10,8 @@ env: GO_VERSION: '1.19' jobs: - setup: - 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 - verify-dependencies: runs-on: ubuntu-latest - needs: setup steps: - name: Checkout code uses: actions/checkout@v2 @@ -37,7 +25,6 @@ jobs: build: runs-on: ubuntu-latest - needs: setup steps: - name: Checkout code uses: actions/checkout@v2 @@ -51,7 +38,6 @@ jobs: vet: runs-on: ubuntu-latest - needs: setup steps: - name: Checkout code uses: actions/checkout@v2 @@ -65,10 +51,14 @@ jobs: staticcheck: runs-on: ubuntu-latest - needs: setup 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 @@ -76,7 +66,6 @@ jobs: golint: runs-on: ubuntu-latest - needs: setup steps: - name: Checkout code uses: actions/checkout@v2 @@ -92,7 +81,6 @@ jobs: test: runs-on: ubuntu-latest - needs: setup steps: - name: Checkout code uses: actions/checkout@v2 @@ -103,15 +91,3 @@ jobs: check-latest: true - name: Run proxmox unit tests run: go test -race -vet=off ./proxmox/... ./internal/... - - version: - runs-on: ubuntu-latest - needs: setup - steps: - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - check-latest: true - - name: Get Go version - run: go version \ No newline at end of file From 1247b884685850724267bd469516e5d3da249490 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:38:56 +0200 Subject: [PATCH 8/8] bump go version --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ef27dfbe..eadb89d3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: branches: [master] env: - GO_VERSION: '1.19' + GO_VERSION: '1.21' jobs: verify-dependencies: