Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache node_modules the same in all workflows #3077

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ jobs:
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.1.4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: cached-node_modules
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install all yarn packages
run: yarn --frozen-lockfile
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile

- name: Check redirects file(s)
run: yarn content validate-redirects en-us --strict
19 changes: 9 additions & 10 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ jobs:
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.1.4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: cached-node_modules
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install all yarn packages
run: yarn --frozen-lockfile
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile

- name: Start the Yari server
run: |
Expand Down