Skip to content

Commit

Permalink
chore: update golangci-lint workflow for improved performance and rel…
Browse files Browse the repository at this point in the history
…iability

- Added concurrency configuration to manage workflow execution and prevent overlapping runs.
- Introduced a wait step to ensure a quiet period of 15 minutes before linting on push events.
- Upgraded the runner environment from Ubuntu 20.04 to Ubuntu 22.04 for better compatibility.
- Updated golangci-lint version from v1.61 to v1.63 to leverage the latest features and fixes.

These changes enhance the efficiency and reliability of the golangci-lint workflow.
  • Loading branch information
tphakala committed Jan 16, 2025
1 parent 7068199 commit b6528e1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
name: golangci-lint

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:
workflow_call: # This is used when the workflow is called from another workflow (e.g. docker-build.yml)
workflow_call:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
#pull-requests: read

jobs:
wait-for-quiet-period:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Wait for quiet period
run: sleep 900 # Wait for 15 minutes

golangci:
needs: [wait-for-quiet-period]
name: lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -36,4 +48,4 @@ jobs:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.61
version: v1.63

0 comments on commit b6528e1

Please sign in to comment.