Skip to content

Commit

Permalink
ci: bump github actions and improve golangci job (#2228)
Browse files Browse the repository at this point in the history
## 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
<!-- If yes, please add the "user facing" label to the PR -->
<!-- If yes, don't forget to include docs changes where relevant -->

## References (if applicable):
<!-- Add relevant Github Issues, Discord threads, or other helpful
information. -->

---------

Co-authored-by: Gyanendra Mishra <[email protected]>
Co-authored-by: leoporoli <[email protected]>
  • Loading branch information
3 people authored Feb 29, 2024
1 parent 404f316 commit 6fb5c1c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/change-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
4 changes: 2 additions & 2 deletions .github/workflows/check-proto-break.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if PR is breaking
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golang-package-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
100 changes: 19 additions & 81 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/issue-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6fb5c1c

Please sign in to comment.