Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cache on lint action #1332

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
go_cache:
name: Install And Cache Go Dependencies and Build Artifacts
name: Cache Go Dependencies and Build/Lint Artifacts
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
Expand All @@ -24,3 +24,9 @@ jobs:

- name: Build
run: go build ./...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I'm confusd with how this works and maybe a chat at standup to explain it to me would help, just so I'm clear how the caching works... I'll have a read too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can discuss it further in the standup but i give you a primer.

With go-setup you have a setup and a teardown step in your workflow.
The first is at the start and searches for a go cache in github cache and retrieves it, the second is done at the end of the workflow and stores go cache folders into github cache.

Go build step populates the cache with artifacts and deps and the linting step adds linting artifacts to the cache as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: Run Golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout 30m --verbose
version: v1.60
1 change: 0 additions & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable
cache: false

- name: Run Golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down
Loading