Skip to content

Commit 22fc584

Browse files
committed
cicd: Use pnpm and asdf-vm
# Conflicts: # package-lock.json
1 parent 0e2ee56 commit 22fc584

File tree

6 files changed

+6405
-11686
lines changed

6 files changed

+6405
-11686
lines changed

.github/workflows/build.yml

+14-17
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [16.x, 18.x, 20.x]
16+
node-version: [16.x, 18.x, 20.x, 22.x]
1717
steps:
1818
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 9
1922
- name: Use Node.js ${{ matrix.node-version }}
2023
uses: actions/setup-node@v4
2124
with:
2225
node-version: ${{ matrix.node-version }}
23-
cache: npm
24-
- name: Use NPM 8
25-
run: npm i -g npm@8
26-
- run: npm ci
26+
cache: pnpm
27+
- run: pnpm i
2728
- name: types
28-
run: npm run check:types
29+
run: pnpm check:types
2930
- name: build
30-
run: npm run build
31+
run: pnpm build
3132
- name: test
3233
id: test
3334
if: ${{ always() }}
34-
run: npm run test
35+
run: pnpm test
3536
- name: Import with CJS
3637
if: ${{ always() }}
3738
run: node smoke-tests/smoke-test-cjs.cjs
@@ -43,10 +44,10 @@ jobs:
4344
run: node smoke-tests/smoke-test.js
4445
- name: lint
4546
if: ${{ always() }}
46-
run: npm run lint
47+
run: pnpm lint
4748
- name: style
4849
if: ${{ always() }}
49-
run: npm run format:check
50+
run: pnpm format:check
5051

5152
codecov: # Send only a single coverage report per run
5253
needs: build
@@ -56,13 +57,9 @@ jobs:
5657
runs-on: ubuntu-latest
5758
steps:
5859
- uses: actions/checkout@v4
59-
- name: Use Node.js lts
60-
uses: actions/setup-node@v4
61-
with:
62-
node-version: lts/*
63-
cache: npm
64-
- run: npm ci
60+
- uses: asdf-vm/actions/install@v3
61+
- run: pnpm i
6562
- name: test
66-
run: npm run test:coverage
63+
run: pnpm test:coverage
6764
- name: codecov
6865
uses: codecov/codecov-action@v4

.github/workflows/release.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,31 @@ jobs:
2323
- uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0 # Need history for changelog generation
26-
- name: Use Node.js lts
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: lts/*
30-
registry-url: https://registry.npmjs.org
31-
- run: npm ci
26+
- uses: asdf-vm/actions/install@v3
27+
- run: pnpm i
3228
- name: types
33-
run: npm run check:types
29+
run: pnpm check:types
3430
- name: build
35-
run: npm run build
31+
run: pnpm build
3632
- name: test
3733
id: test
3834
if: ${{ always() }}
39-
run: npm run test -- --coverage
35+
run: pnpm test --coverage
4036
- name: lint
4137
if: ${{ always() }}
42-
run: npm run lint
38+
run: pnpm lint
4339
- name: style
4440
if: ${{ always() }}
45-
run: npm run format:check
46-
- name: npm auth
47-
run: npm set "//registry.npmjs.org/:_authToken" ${{ env.NPM_TOKEN }}
41+
run: pnpm format:check
42+
- name: npm registry auth
43+
run: pnpm config set "//registry.npmjs.org/:_authToken" ${{ env.NPM_TOKEN }}
4844
- name: config git user
4945
run: |
5046
git config --global user.name ${{ secrets.ACTION_GITHUB_USERNAME }};
5147
git config --global user.email ${{ secrets.ACTION_GITHUB_EMAIL }};
5248
- name: perform release
5349
run: |
54-
npm run release -- \
50+
pnpm release \
5551
${{ github.event.inputs.version }} \
5652
--ci
5753
- name: codecov # Perform after version publishing

.tool-versions

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodejs 20.18.0
2+
pnpm 9.12.2

0 commit comments

Comments
 (0)