From 5aff088839e90aea2e0a7f08c22304049d9746a3 Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Tue, 14 Oct 2025 15:27:09 +0300 Subject: [PATCH] Update the cache use in our workflows (#653) ## Motivation and Context While debugging https://github.com/modelcontextprotocol/registry/pull/631 noticed the cache was weirdly implemented, so the following PR updates the caching strategy across a few of our CI workflows. - Replaced manual actions/cache with the built-in `cache: true` of setup-go - Switched from manual golangci-lint installation to their official golangci-lint-action - Removed redundant go mod download commands - Added cache to the deployment pipeline for both staging and production (we should see faster Pulumi deployments) - Same for the release workflow so hopefully faster release builds ## How Has This Been Tested? ## Breaking Changes No ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context Signed-off-by: Radoslav Dimitrov --- .github/workflows/ci.yml | 36 +++++------------------------------ .github/workflows/deploy.yml | 2 ++ .github/workflows/release.yml | 1 + 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be7ccf9..bae481e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,26 +22,12 @@ jobs: uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version-file: 'go.mod' - - - name: Cache Go modules - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ github.sha }}-${{ hashFiles('**/go.sum', '.golangci.yml') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Download dependencies - run: go mod download - - - name: Install golangci-lint - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0 + cache: true - name: Run lint - run: make lint + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 + with: + version: v2.4.0 - name: Validate schemas and examples run: make validate @@ -66,19 +52,7 @@ jobs: uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version-file: 'go.mod' - - - name: Cache Go modules - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Download dependencies - run: go mod download + cache: true - name: Run all tests run: make test-all diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2bf85fe..62c0f6b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -69,6 +69,7 @@ jobs: uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version-file: 'go.mod' + cache: true - name: Setup Pulumi uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8 @@ -110,6 +111,7 @@ jobs: uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version-file: 'go.mod' + cache: true - name: Setup Pulumi uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0face3f..3e6623a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version-file: 'go.mod' + cache: true - name: Install cosign uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62