Skip to content

Commit

Permalink
💚 Use alternate CI caching
Browse files Browse the repository at this point in the history
Previously, stale local packages might be kept around due to caching symlinks within the
node_modules directories. By caching yarns cache, we can avoid caching our own linked packages
  • Loading branch information
wwilsman committed Sep 11, 2020
1 parent 33af5cb commit dfd84a7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}/node-12/${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}/node-12/
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1/${{ runner.os }}/node-12/${{ hashFiles('**/yarn.lock') }}
restore-keys: v1/${{ runner.os }}/node-12/
- run: yarn
- run: yarn lint
22 changes: 12 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 10
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}/node-10/${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}/node-10/
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1/${{ runner.os }}/node-10/${{ hashFiles('**/yarn.lock') }}
restore-keys: v1/${{ runner.os }}/node-10/
- run: yarn
- run: yarn build
- uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -48,13 +49,14 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}/node-${{ matrix.node }}/${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}/node-${{ matrix.node }}/
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1/${{ runner.os }}/node-${{ matrix.node }}/${{ hashFiles('**/yarn.lock') }}
restore-keys: v1/${{ runner.os }}/node-${{ matrix.node }}/
- uses: actions/download-artifact@v2
with:
name: dist
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}/node-12/${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}/node-12/
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1/${{ runner.os }}/node-12/${{ hashFiles('**/yarn.lock') }}
restore-keys: v1/${{ runner.os }}/node-12/
- run: yarn
- run: yarn test:types

0 comments on commit dfd84a7

Please sign in to comment.