Skip to content

Commit 14b9f43

Browse files
committed
chore(ci): split lint/typecheck into separate checks and extract shared
setup action
1 parent ab2f16c commit 14b9f43

2 files changed

Lines changed: 68 additions & 16 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Setup pnpm and Node dependencies
2+
description: Setup pnpm, setup Node.js with pnpm cache, and install dependencies.
3+
inputs:
4+
node-version:
5+
description: Node.js version to install.
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # tag=v4.1.0
11+
12+
- name: Use Node.js ${{ inputs.node-version }}
13+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
14+
with:
15+
node-version: ${{ inputs.node-version }}
16+
cache: pnpm
17+
18+
- name: Install dependencies
19+
shell: bash
20+
run: pnpm install --frozen-lockfile

.github/workflows/test.yml

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,64 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
verify:
15-
name: Verify [Node ${{ matrix.node_version }}]
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
matrix:
19-
node_version: ['18', '20', '22', '24']
20-
os: [ubuntu-latest]
14+
lint:
15+
name: Lint (Node 24)
16+
runs-on: ubuntu-latest
2117

2218
steps:
2319
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
24-
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # tag=v4.1.0
25-
26-
- name: Use Node.js ${{ matrix.node_version }}
27-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
20+
- name: Setup workspace
21+
uses: ./.github/actions/setup-pnpm-node
2822
with:
29-
node-version: ${{ matrix.node_version }}
30-
cache: 'pnpm'
31-
32-
- name: Install dependencies
33-
run: pnpm install --frozen-lockfile
23+
node-version: '24'
3424

3525
- name: Lint
3626
run: pnpm lint:ci
3727

28+
typecheck:
29+
name: TypeScript (Node 24)
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
34+
- name: Setup workspace
35+
uses: ./.github/actions/setup-pnpm-node
36+
with:
37+
node-version: '24'
38+
3839
- name: Type check
3940
run: pnpm typecheck
4041

42+
test_pr:
43+
name: Tests [Node 24]
44+
if: github.event_name == 'pull_request'
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
49+
- name: Setup workspace
50+
uses: ./.github/actions/setup-pnpm-node
51+
with:
52+
node-version: '24'
53+
54+
- name: Run tests
55+
run: pnpm test
56+
57+
test_main_matrix:
58+
name: Tests [Node ${{ matrix.node_version }}]
59+
if: github.ref == 'refs/heads/main'
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
matrix:
63+
node_version: ['18', '20', '22', '24']
64+
os: [ubuntu-latest]
65+
66+
steps:
67+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
68+
- name: Setup workspace
69+
uses: ./.github/actions/setup-pnpm-node
70+
with:
71+
node-version: ${{ matrix.node_version }}
72+
4173
- name: Run tests
4274
run: pnpm test

0 commit comments

Comments
 (0)