From 6fb5c1cb7b1dedb46c28cda3ce4104d5c65202d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Vincent?= <28714795+leovct@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:25:28 +0100 Subject: [PATCH] ci: bump github actions and improve `golangci` job (#2228) ## Description: - Bump Github actions to remove [warnings](https://github.com/kurtosis-tech/kurtosis/actions/runs/8068319051) (only non breaking releases). - https://github.com/actions/checkout/releases/tag/v4.0.0 - https://github.com/actions/setup-go/releases/tag/v5.0.0 - https://github.com/8BitJonny/gh-get-current-pr/releases/tag/3.0.0 - https://github.com/stefanzweifel/git-auto-commit-action/releases/tag/v5.0.0 - https://github.com/pkgdeps/git-tag-action/releases/tag/v3.0.0 - https://github.com/github/issue-labeler/releases/tag/v3.4 - Simplify `golangci` job by using a matrix. Instead of executing `golangci-lint` in a sequential manner for all folders, it will now concurrently run a total of `n` jobs, each dedicated to a specific folder. This should speed up the execution time. - Fix a small lint issue in `push-docs` job. ## Is this change user facing? NO ## References (if applicable): --------- Co-authored-by: Gyanendra Mishra Co-authored-by: leoporoli --- ...eaking-change-description-title-update.yml | 4 +- .github/workflows/change-versions.yml | 6 +- .github/workflows/check-proto-break.yml | 4 +- .github/workflows/golang-package-tag.yml | 4 +- .github/workflows/golangci-lint.yml | 100 ++++-------------- .github/workflows/issue-labeler.yml | 4 +- .github/workflows/push-docs.yml | 4 +- 7 files changed, 32 insertions(+), 94 deletions(-) diff --git a/.github/workflows/breaking-change-description-title-update.yml b/.github/workflows/breaking-change-description-title-update.yml index aa1b8ba57f..aef4b57ded 100644 --- a/.github/workflows/breaking-change-description-title-update.yml +++ b/.github/workflows/breaking-change-description-title-update.yml @@ -18,11 +18,11 @@ jobs: if: contains(github.head_ref, 'release-please') != true && contains(github.head_ref, 'breaking-release') == true runs-on: ubuntu-latest steps: - - uses: 8BitJonny/gh-get-current-pr@2.2.0 + - uses: 8BitJonny/gh-get-current-pr@3 with: sha: ${{ github.event.pull_request.head.sha }} id: PR - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: | diff --git a/.github/workflows/change-versions.yml b/.github/workflows/change-versions.yml index 289296c51c..3858dd6942 100644 --- a/.github/workflows/change-versions.yml +++ b/.github/workflows/change-versions.yml @@ -9,16 +9,16 @@ jobs: if: contains(github.head_ref, 'release-please') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: "${{ secrets.RELEASER_TOKEN }}" fetch-depth: 0 - name: Change versions - run: | + run: | api/scripts/update-package-versions.sh "$(cat version.txt)" api/scripts/update-own-version-constants.sh "$(cat version.txt)" enclave-manager/web/scripts/update-package-versions.sh "$(cat version.txt)" scripts/update-license-version.sh "$(cat version.txt)" - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: token: "${{ secrets.RELEASER_TOKEN }}" diff --git a/.github/workflows/check-proto-break.yml b/.github/workflows/check-proto-break.yml index d1aeac0c97..7ac520e625 100644 --- a/.github/workflows/check-proto-break.yml +++ b/.github/workflows/check-proto-break.yml @@ -29,11 +29,11 @@ jobs: if: ${{ needs.check-if-code-change.outputs.change == 'true' }} runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: '1.20' - run: go install github.com/bufbuild/buf/cmd/buf@v1.26.1 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Check if PR is breaking diff --git a/.github/workflows/golang-package-tag.yml b/.github/workflows/golang-package-tag.yml index 583b9fe787..c506527bea 100644 --- a/.github/workflows/golang-package-tag.yml +++ b/.github/workflows/golang-package-tag.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get current version run: echo "CURRENT_VERSION=$(cat version.txt)" >> $GITHUB_ENV - name: Tag golang package - uses: pkgdeps/git-tag-action@v2 + uses: pkgdeps/git-tag-action@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} github_repo: ${{ github.repository }} diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7c8da0864d..b9b6a62bda 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -42,94 +42,32 @@ jobs: if: ${{ needs.check-if-code-change.outputs.change == 'true' }} name: golang-lint runs-on: ubuntu-latest + strategy: + matrix: + directory: + - container-engine-lib + - contexts-config-store + - grpc-file-transfer/golang + - metrics-library/golang + - name_generator + - api/golang + - core/server + - core/launcher + - engine/server + - engine/launcher + - internal_testsuites/golang + - cli/cli steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: '1.20' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Generate versions - run: scripts/generate-kurtosis-version.sh - name: lint-container-engine-lib - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: container-engine-lib/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-contexts-config-store - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: contexts-config-store/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-grpc-file-transfer - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: grpc-file-transfer/golang/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-metrics-library - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: metrics-library/golang - args: --timeout=3m - skip-pkg-cache: true - - name: lint-name-generator - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: name_generator/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-api-golang - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: api/golang/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-core-server - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: core/server - args: --timeout=3m - skip-pkg-cache: true - - name: lint-core-launcher - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: core/launcher/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-engine-server - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: engine/server/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-engine-launcher - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: engine/launcher/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-internal-test-suites - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLINT_VERSION }} - working-directory: internal_testsuites/golang/ - args: --timeout=3m - skip-pkg-cache: true - - name: lint-cli - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: ${{ env.GOLINT_VERSION }} - working-directory: cli/cli/ + working-directory: ${{ matrix.directory }} args: --timeout=3m skip-pkg-cache: true diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 9b25117c50..097faa1e8f 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -6,12 +6,12 @@ on: permissions: issues: write contents: read - + jobs: triage: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.1 + - uses: github/issue-labeler@v3 with: configuration-path: .github/issue-labeler.yml enable-versioned-regex: 0 diff --git a/.github/workflows/push-docs.yml b/.github/workflows/push-docs.yml index 73f0272311..7022734a0f 100644 --- a/.github/workflows/push-docs.yml +++ b/.github/workflows/push-docs.yml @@ -27,10 +27,10 @@ jobs: }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: + - name: Enforce to use yarn run: | # We had a bug where we were using both Yarn and NPM to maintain Docusaurus, which # meant separate and conflicting lockfiles