Skip to content

Commit b4b3ff3

Browse files
committed
minor #2504 [CI] Drop explicit Yarn dependencies caching steps for actions/setup-node (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [CI] Drop explicit Yarn dependencies caching steps for actions/setup-node | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> While working on the UX's CI, I noticed that we manually handle Yarn cache (2 _longs_ steps). Instead, we can use `actions/setup-node` and `cache: yarn` to lighten the workflow file and ease the maintenance. Commits ------- 0f086b0 [CI] Drop explicit Yarn dependencies caching steps for actions/setup-node
2 parents 0064420 + 0f086b0 commit b4b3ff3

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

.github/workflows/test.yaml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,9 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- run: corepack enable
20-
- name: Get yarn cache directory path
21-
id: yarn-cache-dir-path
22-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
23-
- uses: actions/cache@v4
24-
id: yarn-cache
20+
- uses: actions/setup-node@v4
2521
with:
26-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
27-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
28-
restore-keys: |
29-
${{ runner.os }}-yarn-
22+
cache: 'yarn'
3023
- run: yarn --immutable
3124
- run: yarn ci
3225

@@ -36,16 +29,12 @@ jobs:
3629
steps:
3730
- uses: actions/checkout@v4
3831
- run: corepack enable
39-
- name: Get yarn cache directory path
40-
id: yarn-cache-dir-path
41-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
42-
- uses: actions/cache@v4
43-
id: yarn-cache
32+
- uses: actions/setup-node@v4
4433
with:
45-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
47-
restore-keys: |
48-
${{ runner.os }}-yarn-
34+
cache: 'yarn'
35+
cache-dependency-path: |
36+
yarn.lock
37+
**/package.json
4938
- run: yarn --immutable && yarn build
5039

5140
- name: Check if JS dist files are current
@@ -130,16 +119,12 @@ jobs:
130119
steps:
131120
- uses: actions/checkout@v4
132121
- run: corepack enable
133-
- name: Get yarn cache directory path
134-
id: yarn-cache-dir-path
135-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
136-
- uses: actions/cache@v4
137-
id: yarn-cache
122+
- uses: actions/setup-node@v4
138123
with:
139-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
140-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
141-
restore-keys: |
142-
${{ runner.os }}-yarn-
124+
cache: 'yarn'
125+
cache-dependency-path: |
126+
yarn.lock
127+
**/package.json
143128
- run: yarn --immutable
144129
- run: yarn playwright install
145130
- run: yarn test

0 commit comments

Comments
 (0)