Skip to content

Commit

Permalink
Use actions/setup-node action to cache Yarn files
Browse files Browse the repository at this point in the history
https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Nov 12, 2022
1 parent 8af4c84 commit 504886b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/daily-snapshots.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache: 'yarn'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/lint-and-analyse-php.yml
Expand Up @@ -21,19 +21,8 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14

- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '14'
cache: 'yarn'

- name: Install modules
run: yarn install --non-interactive
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/other-tools.yml
Expand Up @@ -56,19 +56,8 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14

- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '14'
cache: 'yarn'

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/test-selenium.yml
Expand Up @@ -109,19 +109,8 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14

- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '14'
cache: 'yarn'

- name: Install modules
run: yarn install --non-interactive --production
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/tests.yml
Expand Up @@ -200,19 +200,8 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14

- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '14'
cache: 'yarn'

- name: Install modules
run: yarn install --non-interactive
Expand Down

0 comments on commit 504886b

Please sign in to comment.