Skip to content

Commit 7d406ce

Browse files
committed
use corepack
1 parent 97e78ee commit 7d406ce

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

.github/workflows/node.yml

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: 'Run tests on NodeJS'
22

33
on:
44
push:
@@ -12,49 +12,46 @@ on:
1212

1313
jobs:
1414
default:
15-
runs-on: ${{ matrix.os }}
15+
runs-on: ubuntu-latest
1616
strategy:
17+
fail-fast: false
1718
matrix:
1819
node-version: ['lts/*', '*']
19-
os: [ubuntu-latest]
2020

2121
steps:
22-
- uses: actions/checkout@v3
23-
with:
24-
fetch-depth: 1
25-
26-
- uses: actions/setup-node@v3
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
30-
- uses: pnpm/[email protected]
31-
name: Install pnpm
32-
id: pnpm-install
33-
with:
34-
version: 8
35-
run_install: false
36-
37-
- name: Get pnpm store directory
38-
id: pnpm-cache
39-
run: |
40-
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
41-
42-
- uses: actions/cache@v3
43-
name: Setup pnpm cache
44-
with:
45-
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
46-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47-
restore-keys: |
48-
${{ runner.os }}-pnpm-store-
49-
50-
- name: Install dependencies
51-
run: pnpm install --frozen-lockfile --strict-peer-dependencies
52-
53-
- name: Lint Source
54-
run: pnpm run --if-present lint
55-
56-
- name: Build Source
57-
run: pnpm run --if-present build
58-
59-
- name: Run Tests
60-
run: pnpm run --if-present test
22+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
with:
24+
fetch-depth: 10
25+
26+
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: Enable Corepack
31+
run: corepack enable
32+
33+
- name: Get pnpm store directory
34+
id: pnpm-cache
35+
run: |
36+
echo "::set-output name=pnpm_store_path::$(pnpm store path)"
37+
38+
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
39+
name: Setup pnpm cache
40+
with:
41+
path: ${{ steps.pnpm-cache.outputs.pnpm_store_path }}
42+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-store-
45+
46+
- name: Install dependencies
47+
run: |
48+
pnpm install --frozen-lockfile --strict-peer-dependencies
49+
50+
- name: Lint Source
51+
run: pnpm run --if-present lint
52+
53+
- name: Build Source
54+
run: pnpm run --if-present build
55+
56+
- name: Run Tests
57+
run: pnpm run --if-present test

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@
6767
},
6868
"lint-staged": {
6969
"*.(ts|json)": "eslint --cache --fix"
70-
}
70+
},
71+
"packageManager": "[email protected]+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
7172
}

0 commit comments

Comments
 (0)