Skip to content

Commit

Permalink
.github: Avoid disabling the go mod pkg cache for the golangci-lint a…
Browse files Browse the repository at this point in the history
…ction (#2660)

* .github: Avoid disabling go mod cache for the golangci-lint action

Update the sanity workflow and avoid setting the 'skip-pkg-cache' option
to true so the golangci-lint action can start caching and restoring the
~/go/pkg directory during CI runs.

Signed-off-by: timflannagan <timflannagan@gmail.com>

* .github: Separate the golangci-lint step into it's own job

As advertised in the action's official documentation, it's easier to
separate this action into it's own job so it can run in parallel with
other jobs defined within an individual workflow. When removing this
flag in the previous commit, the action was silently failing as it
couldn't access the go module package cache due to what appeared to be
permissions-related failures. Moving the golangci-lint action to it's
own job fixed those silent failures.

Signed-off-by: timflannagan <timflannagan@gmail.com>
  • Loading branch information
timflannagan authored Feb 21, 2022
1 parent 094ae7b commit a76e610
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ on:
pull_request:
workflow_dispatch:
jobs:
sanity:
vendor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v2
with:
go-version: '~1.17'
- name: Run sanity checks
run: make vendor && make diff
- name: Run linting checks
uses: "golangci/golangci-lint-action@v2"
with:
version: "v1.43"
skip-go-installation: true
skip-pkg-cache: true
- uses: actions/checkout@v1
- uses: actions/setup-go@v2
with:
go-version: '~1.17'
- name: Run sanity checks
run: make vendor && make diff
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run linting checks
uses: "golangci/golangci-lint-action@v2"
with:
version: "v1.43"

0 comments on commit a76e610

Please sign in to comment.