diff --git a/.github/workflows/gen_coverage_report.yml b/.github/workflows/gen_coverage_report.yml index 2479605e1d..4608ada52f 100644 --- a/.github/workflows/gen_coverage_report.yml +++ b/.github/workflows/gen_coverage_report.yml @@ -22,10 +22,21 @@ jobs: with: token: ${{ secrets.GH_CQ_BOT }} - name: Set up Go 1.x + id: setup-go uses: actions/setup-go@v6 with: go-version: "1.25" cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}- + ${{ runner.os }}-go- - name: Generate Coverage Report run: make coverage diff --git a/.github/workflows/go_mod_tidy_examples.yml b/.github/workflows/go_mod_tidy_examples.yml index 487053b0fc..b5a15e2c0e 100644 --- a/.github/workflows/go_mod_tidy_examples.yml +++ b/.github/workflows/go_mod_tidy_examples.yml @@ -21,10 +21,21 @@ jobs: with: token: ${{ secrets.GH_CQ_BOT }} - name: Set up Go 1.x + id: setup-go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}- + ${{ runner.os }}-go- - name: Run go mod tidy working-directory: examples/${{ matrix.plugin }} run: go mod tidy diff --git a/.github/workflows/lint_golang.yml b/.github/workflows/lint_golang.yml index 3d65c2faa1..ef096cb302 100644 --- a/.github/workflows/lint_golang.yml +++ b/.github/workflows/lint_golang.yml @@ -18,8 +18,20 @@ jobs: steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 + id: setup-go with: go-version-file: go.mod + cache: false + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}- + ${{ runner.os }}-go- - name: golangci-lint uses: golangci/golangci-lint-action@v9 with: diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 2631ee1791..93a635fb45 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -21,9 +21,27 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v6 - name: Set up Go 1.x + id: setup-go uses: actions/setup-go@v6 with: go-version-file: go.mod + cache: false + - name: Determine Go cache directories + id: go-cache + shell: bash + run: | + echo "gocache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "gomodcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ${{ steps.go-cache.outputs.gomodcache }} + ${{ steps.go-cache.outputs.gocache }} + key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}- + ${{ runner.os }}-go- - run: go mod download - run: go build ./... - name: Run tests