Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d4f7b56

Browse files
committedAug 6, 2024·
ci: update build workflows to use setup/node cache
1 parent 08133a7 commit d4f7b56

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed
 

‎.github/workflows/main.yml

+8-21
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,21 @@ jobs:
2424
node-version: [18, 20, 21]
2525

2626
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
30-
- name: Determine Yarn Cache Path
31-
id: yarn-cache-dir-path
32-
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
- uses: actions/checkout@v4
3328

34-
- uses: actions/cache@v4
35-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
36-
with:
37-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
38-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-yarn-
29+
- run: corepack enable
4130

42-
- name: Use Node.js ${{ matrix.node-version }}
43-
uses: actions/setup-node@v4
31+
- uses: actions/setup-node@v4
4432
with:
45-
node-version: ${{ matrix.node-version }}
33+
node-version: 22
34+
cache: yarn
35+
cache-dependency-path: "**/yarn.lock"
4636

47-
- name: Install Packages
48-
run: yarn install --frozen-lockfile
37+
- run: yarn install --frozen-lockfile
4938

50-
- name: Build
51-
run: yarn build
39+
- run: yarn build
5240

5341
- name: Test
5442
run: yarn test --runInBand=false --maxWorkers=2 --workerIdleMemoryLimit=2GB # https://github.com/facebook/jest/issues/11956
5543
env:
56-
CI: true
5744
NODE_OPTIONS: --max_old_space_size=4096

0 commit comments

Comments
 (0)
Please sign in to comment.