Skip to content

Commit 0cb4e46

Browse files
authored
Update main.yml
Use corepack
1 parent 4a86ba4 commit 0cb4e46

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,40 @@
11
name: ci
2+
23
on:
34
push:
45
branches:
56
- main
67
pull_request:
78
branches:
89
- main
10+
911
jobs:
10-
cache-and-install:
12+
lint:
1113
runs-on: ubuntu-latest
1214

1315
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
17-
- uses: pnpm/action-setup@v4
18-
name: Install pnpm
19-
with:
20-
run_install: false
21-
22-
- name: Install Node.js
23-
uses: actions/setup-node@v4
16+
- uses: actions/checkout@v4
17+
- run: npm i -g --force corepack && corepack enable
18+
- uses: actions/setup-node@v4
2419
with:
2520
node-version: 20
26-
cache: 'pnpm'
21+
cache: "pnpm"
2722

28-
- name: Get pnpm store directory
29-
shell: bash
30-
run: |
31-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
23+
- run: pnpm build
24+
- run: pnpm lint
3225

33-
- uses: actions/cache@v4
34-
name: Setup pnpm cache
35-
with:
36-
path: ${{ env.STORE_PATH }}
37-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38-
restore-keys: |
39-
${{ runner.os }}-pnpm-store-
26+
test:
27+
runs-on: ubuntu-latest
4028

41-
- name: Install dependencies
42-
run: pnpm install
29+
steps:
30+
- uses: actions/checkout@v4
31+
- run: npm i -g --force corepack && corepack enable
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: "pnpm"
4336

44-
- name: Run Build
45-
run: pnpm build
37+
- run: pnpm build
4638

47-
- name: Run unit tests
48-
run: pnpm run test:unit
39+
- name: Test
40+
run: pnpm test:unit

0 commit comments

Comments
 (0)