Skip to content

Commit 5aff088

Browse files
authored
Update the cache use in our workflows (#653)
<!-- Provide a brief summary of your changes --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> While debugging #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? <!-- Have you tested this in a real application? Which scenarios were tested? --> ## Breaking Changes <!-- Will users need to update their code or configurations? --> No ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] 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 <!-- Add any other context, implementation notes, or design decisions --> Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 087d808 commit 5aff088

File tree

3 files changed

+8
-31
lines changed

3 files changed

+8
-31
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,12 @@ jobs:
2222
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
2323
with:
2424
go-version-file: 'go.mod'
25-
26-
- name: Cache Go modules
27-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
28-
with:
29-
path: |
30-
~/.cache/go-build
31-
~/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ github.sha }}-${{ hashFiles('**/go.sum', '.golangci.yml') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
35-
36-
- name: Download dependencies
37-
run: go mod download
38-
39-
- name: Install golangci-lint
40-
run: |
41-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0
25+
cache: true
4226

4327
- name: Run lint
44-
run: make lint
28+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
29+
with:
30+
version: v2.4.0
4531

4632
- name: Validate schemas and examples
4733
run: make validate
@@ -66,19 +52,7 @@ jobs:
6652
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
6753
with:
6854
go-version-file: 'go.mod'
69-
70-
- name: Cache Go modules
71-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
72-
with:
73-
path: |
74-
~/.cache/go-build
75-
~/go/pkg/mod
76-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
77-
restore-keys: |
78-
${{ runner.os }}-go-
79-
80-
- name: Download dependencies
81-
run: go mod download
55+
cache: true
8256

8357
- name: Run all tests
8458
run: make test-all

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
7070
with:
7171
go-version-file: 'go.mod'
72+
cache: true
7273

7374
- name: Setup Pulumi
7475
uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8
@@ -110,6 +111,7 @@ jobs:
110111
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
111112
with:
112113
go-version-file: 'go.mod'
114+
cache: true
113115

114116
- name: Setup Pulumi
115117
uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
2323
with:
2424
go-version-file: 'go.mod'
25+
cache: true
2526

2627
- name: Install cosign
2728
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62

0 commit comments

Comments
 (0)