Skip to content

Commit

Permalink
ci(i): Bump all gh-action versions to support node20 (#2780)
Browse files Browse the repository at this point in the history
## Relevant issue(s)
Resolves #2778

## Description
- Similar to #990
- Update all actions to `node20` versions
- There was a bug the way we were using artifacts previously such that
it would overwrite some generated code coverage reports due to artifact
name clashing, this was caught as the behavior of "artifact name
clashing" now causes error instead of "merging" them. The fix is in the
last commit, which will now ensure "more" accurate coverage as the
missing 3 reports are also included.

### Go Releaser
- This should be done outside this PR, made an issue here:
#2781

## How has this been tested?
- `act` tool
- ci

Specify the platform(s) on which this was tested:
- WSL2
  • Loading branch information
shahzadlone authored Jun 27, 2024
1 parent 1a8b1fa commit 343ec38
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 68 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ jobs:
steps:

- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Build all dependencies
run: make deps
6 changes: 3 additions & 3 deletions .github/workflows/build-then-deploy-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Environment version target
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -89,10 +89,10 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Terraform action setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.3.7

Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/check-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Try generating cli documentation
run: make docs:cli
Expand All @@ -58,13 +59,14 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Try generating http documentation
run: make docs:http
Expand All @@ -83,13 +85,14 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Try generating readme toc
run: make toc
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/check-mocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Try generating mocks
run: make mocks
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/check-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jobs:
steps:

- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

# This checks mod tidy is not broken.
- name: Check mod tidy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
go-version-input: "1.21"
go-package: ./...
check-latest: true
cache: true
cache: false
2 changes: 1 addition & 1 deletion .github/workflows/combine-bot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- name: Create combined pr
id: create-combined-pr
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/lint-then-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

# Setting up Go explicitly is required for v3.0.0+ of golangci/golangci-lint-action.
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Run the golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6

with:
# Required: the version of golangci-lint is required.
Expand Down Expand Up @@ -192,7 +193,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run the full bechmarking suite
if: needs.decide-benchmark-type.outputs.benchmark-type == 'FULL'
Expand All @@ -214,7 +215,7 @@ jobs:
if: |
github.event_name == 'push' &&
github.ref_name == 'develop'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bench-artifact-${{ github.sha }}
path: bench-artifact-${{ github.sha }}.txt
Expand Down Expand Up @@ -245,7 +246,7 @@ jobs:
if: |
github.event_name == 'pull_request' &&
github.base_ref == 'develop'
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.ONLY_DEFRADB_REPO_CI_PAT }}
workflow: lint-then-benchmark.yml
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ on:
push:

permissions:
# Allow read access to pull request (Required for the `only-new-issues` option.)
# Required for the `only-new-issues` option.
pull-requests: read
# Required for analysis.
contents: read
# Required to annotate code in the PR.
checks: write

jobs:
lint-go:
Expand All @@ -31,16 +34,18 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

# Setting up Go explicitly is required for v3.0.0+ of golangci/golangci-lint-action.
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Run golangci-lint linter
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required.
# Note: The version should not pick the patch version as the latest patch
Expand Down Expand Up @@ -75,7 +80,7 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run yamllint linter
uses: ibiqlik/action-yamllint@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/preview-ami-with-terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Stop and notify the use of unprivileged flow or missing tokens
if: env.AWS_ACCESS_KEY_ID == '' || env.AWS_SECRET_ACCESS_KEY == ''
# Note: Fail this step, as we don't want unprivileged access doing these changes.
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
let unprivileged_warning =
Expand All @@ -64,10 +64,10 @@ jobs:
core.setFailed(unprivileged_warning)
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Terraform action setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.3.7

Expand All @@ -93,7 +93,7 @@ jobs:
continue-on-error: true

- name: Comment results on pull request
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
TERRAFORM_PLAN_OUTPUT: "Terraform Plan Output:\n${{ steps.terraform-plan.outputs.stdout }}\n"

Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:

steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: true
cache: false

- name: Apply tag
run: git tag ${{ github.event.inputs.tag }}
Expand All @@ -50,18 +50,18 @@ jobs:

- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Log in to Docker Hub
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -109,22 +109,22 @@ jobs:
needs: prepare
steps:
- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Apply tag
run: git tag ${{ github.event.inputs.tag }}

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: true
cache: false

- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:

steps:
- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/start-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ jobs:
steps:

- name: Checkout code into the directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: 'go.mod'
check-latest: true
cache: false

- name: Build modules
run: make deps:modules
Expand Down
Loading

0 comments on commit 343ec38

Please sign in to comment.