Skip to content

Commit

Permalink
chore(ci): more caching tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Feb 15, 2024
1 parent 32b8a9f commit 65cb954
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
18 changes: 15 additions & 3 deletions .github/actions/build-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ runs:
using: "composite"
# Make sure to keep these cache entries in sync with those in writecache.yml
steps:
- id: find-go-build-cache
shell: bash
run: echo "cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
- name: Restore Go Modules Cache
id: cache-go-modules
uses: actions/cache/restore@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go
path: |
~/go/pkg/mod
${{ steps.find-go-build-cache.outputs.cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
${{ runner.os }}-
- name: Restore Maven Modules Cache
id: cache-maven
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
15 changes: 9 additions & 6 deletions .github/workflows/writecache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ jobs:
run: mvn dependency:resolve --batch-mode
- name: Download Go Dependencies
run: go mod download -x
- name: Save Go Modules Cache
id: cache-go-modules
uses: actions/cache/save@v4
- id: find-go-build-cache
shell: bash
run: echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
- uses: actions/cache/save@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go
path: |
~/go/pkg/mod
${{ steps.find-go-build-cache.outputs.cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Save Maven Modules Cache
id: cache-maven
uses: actions/cache/save@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

0 comments on commit 65cb954

Please sign in to comment.