Skip to content

Commit 57170ed

Browse files
committed
ci: update workflow
1 parent 36eaa8a commit 57170ed

File tree

1 file changed

+56
-43
lines changed

1 file changed

+56
-43
lines changed

.github/workflows/node.yml

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
name: 'Run tests on NodeJS'
1+
name: "Run tests on NodeJS"
22

33
on:
44
push:
55
paths:
6-
- '.github/workflows/**'
7-
- 'src/**'
8-
- 'tests/**'
9-
- 'package.json'
10-
- 'pnpm-lock.yaml'
6+
- ".github/workflows/node.yml"
7+
- "src/**"
8+
- "tests/**"
9+
- "types/**"
10+
- "package.json"
11+
- "pnpm-lock.yaml"
12+
pull_request:
13+
paths:
14+
- ".github/workflows/node.yml"
15+
- "src/**"
16+
- "tests/**"
17+
- "types/**"
18+
- "package.json"
19+
- "pnpm-lock.yaml"
1120
workflow_dispatch:
1221

1322
jobs:
@@ -16,42 +25,46 @@ jobs:
1625
strategy:
1726
fail-fast: false
1827
matrix:
19-
node-version: ['lts/*', '*']
28+
node-version: ["lts/*", "latest"]
29+
vite-version: ["vite@5", "vite@6", "vite@7"]
2030

2131
steps:
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
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 10
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: ${{ matrix.node-version }}
39+
40+
- name: Enable Corepack
41+
run: |
42+
corepack prepare pnpm@9.15.3 --activate
43+
corepack enable
44+
45+
- name: Get pnpm store directory
46+
id: pnpm-cache
47+
run: |
48+
echo "::set-output name=pnpm_store_path::$(pnpm store path)"
49+
50+
- uses: actions/cache@v4
51+
name: Set up pnpm cache
52+
with:
53+
path: ${{ steps.pnpm-cache.outputs.pnpm_store_path }}
54+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-store-
57+
58+
- name: Install dependencies
59+
run: |
60+
pnpm install --frozen-lockfile --strict-peer-dependencies
61+
pnpm install ${{ matrix.vite-version }}
62+
63+
- name: Lint Source
64+
run: pnpm exec biome ci
65+
66+
- name: Build Source
67+
run: pnpm run --if-present build
68+
69+
- name: Run Tests
70+
run: pnpm run --if-present test

0 commit comments

Comments
 (0)