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

Decrease linter's memory usage #1194

Merged
merged 11 commits into from
Mar 12, 2024
Prev Previous commit
Next Next commit
Add linter analysis cache restore step before running the linter
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
ulucinar committed Mar 6, 2024

Verified

This commit was signed with the committer’s verified signature.
ulucinar Alper Rifat Ulucinar
commit 3e46cfabc176673b20f8b1b4b3c5a386bd633e05
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -51,7 +51,8 @@ jobs:
id: go_cache
run: |
echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT && \
echo "mod_cache=$(make go.mod.cachedir)" >> $GITHUB_OUTPUT
echo "mod_cache=$(make go.mod.cachedir)" >> $GITHUB_OUTPUT && \
echo "analysis_cache=$HOME/.cache/golangci-lint" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
@@ -67,8 +68,19 @@ jobs:
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-

- name: Cache Linter Analysis
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ${{ steps.go_cache.outputs.analysis_cache }}
key: ${{ runner.os }}-analysis-lint-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-analysis-lint-

- name: Vendor Dependencies
run: make vendor vendor.check

- name: Lint
run: make lint
env:
GOLANGCI_LINT_CACHE: ${{ steps.go_cache.outputs.analysis_cache }}
run: |
echo ${GOLANGCI_LINT_CACHE} && \
make lint