From c2a44684b05a5d63690f11e531d0879720a14557 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 6 Mar 2024 15:22:20 +0300 Subject: [PATCH] Add linter analysis cache restore step before running the linter Signed-off-by: Alper Rifat Ulucinar --- .github/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0683d76c4..09633e2c70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" >> $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 \ No newline at end of file + env: + GOLANGCI_LINT_CACHE: ${{ steps.go_cache.outputs.analysis_cache }} + run: | + echo ${GOLANGCI_LINT_CACHE} && \ + make lint \ No newline at end of file