Skip to content

Commit

Permalink
Use faster compression for GitHub Actions cache
Browse files Browse the repository at this point in the history
All the cache keys have also been changed to ensure all archives are recreated
  • Loading branch information
colinrotherham committed Jun 26, 2023
1 parent 6ef1864 commit ea9eb03
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ runs:
id: build-cache

with:
enableCrossOsArchive: true

# Restore build cache (unless commit SHA changes)
key: build-cache-${{ runner.os }}-${{ github.sha }}
key: build-${{ runner.os }}-${{ github.sha }}
path: |
packages/*/dist
shared/*/dist
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/actions/install-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ runs:
id: npm-install-cache

with:
enableCrossOsArchive: true

# Restore `node_modules` cache (unless packages change)
key: npm-install-cache-${{ runner.os }}-${{ hashFiles('package-lock.json', '**/package.json') }}
key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json', '**/package.json') }}
path: |
node_modules
docs/examples/*/node_modules
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
- name: Cache browser download
uses: actions/cache@v3
with:
key: puppeteer-cache-${{ runner.os }}
enableCrossOsArchive: true
key: puppeteer-${{ runner.os }}
path: .cache/puppeteer

- name: Build
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ jobs:
if: ${{ matrix.task.cache }}
uses: actions/cache@v3
with:
key: ${{ matrix.task.name }}-cache-${{ runner.os }}
enableCrossOsArchive: true
key: ${{ matrix.task.name }}-${{ runner.os }}
path: ${{ matrix.task.cache }}

- name: Run lint task
Expand Down Expand Up @@ -156,7 +157,8 @@ jobs:
if: ${{ matrix.task.cache }}
uses: actions/cache@v3
with:
key: ${{ matrix.task.name }}-cache-${{ runner.os }}
enableCrossOsArchive: true
key: ${{ matrix.task.name }}-${{ runner.os }}
path: ${{ matrix.task.cache }}

- name: Run test task
Expand Down

0 comments on commit ea9eb03

Please sign in to comment.