Skip to content

Commit e9c2a7c

Browse files
committed
ci: add caching for Go modules and Maven dependencies
Add caching to speed up CI builds by caching: - Go modules (~/.cache/go-build and ~/go/pkg/mod) based on go.sum - Maven dependencies (~/.m2/repository) based on pom.xml This significantly reduces build times by avoiding re-downloading dependencies on every CI run. Cache keys are based on dependency file hashes, so cache is invalidated when dependencies change. Benefits: - Faster Go builds (no need to download modules each time) - Faster Maven builds (no need to download dependencies each time) - Reduced network usage and CI minutes
1 parent 1af7b85 commit e9c2a7c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/tilt-ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ jobs:
4646
go-version: '1.23'
4747
check-latest: true
4848

49+
- name: Cache Go modules
50+
uses: actions/cache@v4
51+
with:
52+
path: |
53+
~/.cache/go-build
54+
~/go/pkg/mod
55+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
56+
restore-keys: |
57+
${{ runner.os }}-go-
58+
4959
- name: Setup Helm
5060
uses: azure/setup-helm@v4
5161
with:
@@ -257,6 +267,14 @@ jobs:
257267
java -version
258268
mvn --version
259269
270+
- name: Cache Maven dependencies
271+
uses: actions/cache@v4
272+
with:
273+
path: ~/.m2/repository
274+
key: ${{ runner.os }}-maven-${{ hashFiles('demo-app/pom.xml') }}
275+
restore-keys: |
276+
${{ runner.os }}-maven-
277+
260278
- name: Get dependencies
261279
run: go mod download
262280

0 commit comments

Comments
 (0)