From ab42fab540abc2ecd79331c9c69b3507cc594fd5 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Fri, 4 Aug 2023 12:38:21 +0200 Subject: [PATCH] GitHub Actions: use actions/setup-go@v4 and go-version: 1.x There was a mix of diferent action and Go versions specified throughout the GitHub Actions workflow configs. In general, we want to be compatible with the latest Go 1.x version, so just specify that instead of bumping versions everywhere when necessary. At the same time, bump the actions/setup-go to v4, the latest currently available version. This prefers versions already cached on the runner and enables automatic caching for dependencies. --- .github/workflows/compliance.yml | 4 ++-- .github/workflows/go.yml | 24 ++++++++++++------------ .github/workflows/integration-tests.yml | 4 ++-- .github/workflows/sql.yml | 4 ++-- .github/workflows/version.yml | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index c0947546..2fff3ec4 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,9 +11,9 @@ jobs: steps: - run: sudo apt install -y moreutils - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - uses: actions/checkout@v2 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index aadb5a37..ba3c4b38 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - run: go build -gcflags="-m" ./... @@ -29,9 +29,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: ^1.19 + go-version: 1.x - uses: dominikh/staticcheck-action@29e9b80fb8de0521ba4ed3fdf68fed5bbe82a2d2 # v1.1.0 with: @@ -42,9 +42,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - run: go vet ./... @@ -53,9 +53,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - name: Run gofmt -d . run: | @@ -68,9 +68,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - name: Run go mod tidy run: | @@ -83,9 +83,9 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: - go-version: ^1.18 + go-version: 1.x - name: Checkout base commit uses: actions/checkout@v3 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index dff8112c..86efdc48 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -26,9 +26,9 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: '^1.18' + go-version: 1.x - name: Build Icinga DB run: go build ./cmd/icingadb env: diff --git a/.github/workflows/sql.yml b/.github/workflows/sql.yml index c5e4304f..827f17e3 100644 --- a/.github/workflows/sql.yml +++ b/.github/workflows/sql.yml @@ -36,9 +36,9 @@ jobs: steps: - name: Setup Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: '^1.16' + go-version: 1.x - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 98d28c0e..dbdf974e 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -12,9 +12,9 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: - go-version: 1.18.x + go-version: 1.x - name: Check version # TODO(elippmann): Needs adjustments as soon as we release from (support) branches too. run: |