Skip to content

Commit

Permalink
ci: save downloaded NPM tarballs in the CI cache (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas authored Aug 12, 2024
1 parent 213c9e0 commit ef5094e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/actions/build-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,14 @@ runs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: Restore NPM Cache
id: cache-npm
uses: actions/cache/restore@v4
with:
path: .hermit/node/cache/_cacache
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
${{ runner.os }}-npm-
11 changes: 10 additions & 1 deletion .github/workflows/writecache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
run: just build-all
- name: Download Go Dependencies
run: go mod download -x
- name: Download NPM Dependencies
run: find . -name package-lock.json -execdir npm ci \;
- id: find-go-build-cache
shell: bash
run: echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
- uses: actions/cache/save@v4
- name: Save Go Module Cache
uses: actions/cache/save@v4
with:
path: |
~/go/pkg/mod
Expand All @@ -38,3 +41,9 @@ jobs:
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Save NPM Modules Cache
id: cache-npm
uses: actions/cache/save@v4
with:
path: .hermit/node/cache/_cacache
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}

0 comments on commit ef5094e

Please sign in to comment.