From b6528e19b2b328ab94a8a31d429e964c3a033890 Mon Sep 17 00:00:00 2001 From: "Tomi P. Hakala" Date: Thu, 16 Jan 2025 08:05:45 +0200 Subject: [PATCH] chore: update golangci-lint workflow for improved performance and reliability - 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. --- .github/workflows/golangci-lint.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e854806c..cee1c2d9 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -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 @@ -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 \ No newline at end of file + version: v1.63 \ No newline at end of file