Skip to content

Commit 504886b

Browse files
committed
Use actions/setup-node action to cache Yarn files
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>
1 parent 8af4c84 commit 504886b

5 files changed

Lines changed: 9 additions & 53 deletions

File tree

.github/workflows/daily-snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/setup-node@v3
4444
with:
4545
node-version: ${{ matrix.node-version }}
46-
cache: yarn
46+
cache: 'yarn'
4747

4848
- name: Set up Python ${{ matrix.python-version }}
4949
uses: actions/setup-python@v3

.github/workflows/lint-and-analyse-php.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,8 @@ jobs:
2121
- name: Set up Node
2222
uses: actions/setup-node@v3
2323
with:
24-
node-version: 14
25-
26-
- name: Get Yarn cache directory path
27-
id: yarn-cache-dir-path
28-
run: echo "::set-output name=dir::$(yarn cache dir)"
29-
30-
- name: Cache Yarn dependencies
31-
uses: actions/cache@v3
32-
with:
33-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
34-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
35-
restore-keys: |
36-
${{ runner.os }}-yarn-
24+
node-version: '14'
25+
cache: 'yarn'
3726

3827
- name: Install modules
3928
run: yarn install --non-interactive

.github/workflows/other-tools.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,8 @@ jobs:
5656
- name: Set up Node
5757
uses: actions/setup-node@v3
5858
with:
59-
node-version: 14
60-
61-
- name: Get Yarn cache directory path
62-
id: yarn-cache-dir-path
63-
run: echo "::set-output name=dir::$(yarn cache dir)"
64-
65-
- name: Cache Yarn dependencies
66-
uses: actions/cache@v3
67-
with:
68-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
69-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
70-
restore-keys: |
71-
${{ runner.os }}-yarn-
59+
node-version: '14'
60+
cache: 'yarn'
7261

7362
- name: Set up Python
7463
uses: actions/setup-python@v2

.github/workflows/test-selenium.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,8 @@ jobs:
109109
- name: Set up Node
110110
uses: actions/setup-node@v3
111111
with:
112-
node-version: 14
113-
114-
- name: Get Yarn cache directory path
115-
id: yarn-cache-dir-path
116-
run: echo "::set-output name=dir::$(yarn cache dir)"
117-
118-
- name: Cache Yarn dependencies
119-
uses: actions/cache@v3
120-
with:
121-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
122-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
123-
restore-keys: |
124-
${{ runner.os }}-yarn-
112+
node-version: '14'
113+
cache: 'yarn'
125114

126115
- name: Install modules
127116
run: yarn install --non-interactive --production

.github/workflows/tests.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,8 @@ jobs:
200200
- name: Set up Node
201201
uses: actions/setup-node@v3
202202
with:
203-
node-version: 14
204-
205-
- name: Get Yarn cache directory path
206-
id: yarn-cache-dir-path
207-
run: echo "::set-output name=dir::$(yarn cache dir)"
208-
209-
- name: Cache Yarn dependencies
210-
uses: actions/cache@v3
211-
with:
212-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
213-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
214-
restore-keys: |
215-
${{ runner.os }}-yarn-
203+
node-version: '14'
204+
cache: 'yarn'
216205

217206
- name: Install modules
218207
run: yarn install --non-interactive

0 commit comments

Comments
 (0)