Skip to content

Commit

Permalink
fix(ci): cache node modules as well
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick committed Mar 16, 2024
1 parent 728a729 commit 3f03196
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/zxc-lint-snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,24 @@ jobs:
- name: Setup Yarn
run: npm install -g corepack && corepack enable

- name: Cache Dependencies
- name: Yarn Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ${{ env.PROJECT_DIRECTORY }}/.yarn/cache
key: yarn-cache-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
key: yarn-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
restore-keys: |
yarn-cache-${{ inputs.snap-package-dir }}-
yarn-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-
- name: Node Modules Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
${{ env.PROJECT_DIRECTORY }}/node_modules
${{ env.PROJECT_DIRECTORY }}/packages/snap/node_modules
${{ env.PROJECT_DIRECTORY }}/packages/site/node_modules
key: node-modules-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
restore-keys: |
node-modules-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-
- name: Install Snap Dependencies
working-directory: ${{ env.PROJECT_DIRECTORY }}
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/zxc-test-snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,24 @@ jobs:
- name: Setup Yarn
run: npm install -g corepack && corepack enable

- name: Cache Dependencies
- name: Yarn Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ${{ env.PROJECT_DIRECTORY }}/.yarn/cache
key: yarn-cache-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
key: yarn-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
restore-keys: |
yarn-cache-${{ inputs.snap-package-dir }}-
yarn-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-
- name: Node Modules Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
${{ env.PROJECT_DIRECTORY }}/node_modules
${{ env.PROJECT_DIRECTORY }}/packages/snap/node_modules
${{ env.PROJECT_DIRECTORY }}/packages/site/node_modules
key: node-modules-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-${{ hashFiles(format('packages/{0}/yarn.lock', inputs.snap-package-dir)) }}
restore-keys: |
node-modules-cache-${{ runner.os }}-${{ inputs.snap-package-dir }}-
- name: Install Snap Dependencies
working-directory: ${{ env.PROJECT_DIRECTORY }}
Expand Down

0 comments on commit 3f03196

Please sign in to comment.