From 77438db86dd32a2638377751f3e1e73272b1704e Mon Sep 17 00:00:00 2001 From: Jonas L Date: Fri, 31 May 2024 11:32:19 +0200 Subject: [PATCH] ci: setup go version using go.mod file (#653) Use the `go.mod` file to determine the version of go to run in CI. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/goreleaser.yml | 2 +- .github/workflows/test_e2e.yml | 20 ++++++++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69c16b346..203ce4373 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version-file: go.mod - run: go test -v -race -coverprofile=coverage.txt ./... @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version-file: go.mod - uses: golangci/golangci-lint-action@v6 with: diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 004da0d40..018e7bfef 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version-file: go.mod - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/test_e2e.yml b/.github/workflows/test_e2e.yml index 588e02355..d3714e101 100644 --- a/.github/workflows/test_e2e.yml +++ b/.github/workflows/test_e2e.yml @@ -25,14 +25,18 @@ jobs: CERT_DOMAIN: hc-integrations-test.de steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.21" - - uses: actions/checkout@master + go-version-file: go.mod + + - uses: hetznercloud/setup-hcloud@v1 + - uses: hetznercloud/tps-action@main with: token: ${{ secrets.HCLOUD_TOKEN }} - - uses: hetznercloud/setup-hcloud@v1 + - uses: yokawasa/action-setup-kube-tools@v0.11.1 with: setup-tools: | @@ -131,14 +135,18 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.21" - - uses: actions/checkout@master + go-version-file: go.mod + + - uses: hetznercloud/setup-hcloud@v1 + - uses: hetznercloud/tps-action@main with: token: ${{ secrets.HCLOUD_TOKEN }} - - uses: hetznercloud/setup-hcloud@v1 + - uses: yokawasa/action-setup-kube-tools@v0.11.1 with: setup-tools: |