Skip to content

Commit

Permalink
minor #2504 [CI] Drop explicit Yarn dependencies caching steps for ac…
Browse files Browse the repository at this point in the history
…tions/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
  • Loading branch information
Kocal committed Jan 14, 2025
2 parents 0064420 + 0f086b0 commit b4b3ff3
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
- uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
- run: yarn --immutable
- run: yarn ci

Expand All @@ -36,16 +29,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
- uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
cache-dependency-path: |
yarn.lock
**/package.json
- run: yarn --immutable && yarn build

- name: Check if JS dist files are current
Expand Down Expand Up @@ -130,16 +119,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
- uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
cache-dependency-path: |
yarn.lock
**/package.json
- run: yarn --immutable
- run: yarn playwright install
- run: yarn test

0 comments on commit b4b3ff3

Please sign in to comment.