Skip to content

Commit 7fe1fc1

Browse files
authored
ci: run checks first then run build (#20)
* ci: run checks first then run build * chore: change job name * chore: test cache
1 parent 5a7c421 commit 7fe1fc1

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,34 @@ on:
77
pull_request:
88

99
jobs:
10-
build:
10+
code_quality:
1111
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
node-version: [20.x, 24.x]
15-
name: Build on v${{ matrix.node-version }}
1612
steps:
1713
- uses: actions/checkout@v4
18-
19-
- name: Setup pnpm
20-
uses: pnpm/action-setup@v2
21-
22-
- name: Setup Node.js v${{ matrix.node-version }}
23-
uses: actions/setup-node@v4
14+
- uses: pnpm/action-setup@v2
15+
- uses: actions/setup-node@v4
2416
with:
25-
node-version: ${{ matrix.node-version }}
17+
node-version: 22.x
2618
cache: 'pnpm'
2719

28-
- name: Cache pnpm store
29-
uses: actions/cache@v4
30-
with:
31-
path: ~/.pnpm-store
32-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
33-
restore-keys: |
34-
${{ runner.os }}-pnpm-
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm lint
22+
- run: pnpm typecheck
3523

36-
- name: Cache Next.js build cache
37-
uses: actions/cache@v4
24+
build:
25+
needs: code_quality
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: pnpm/action-setup@v2
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 20.x
33+
cache: 'pnpm'
34+
- uses: actions/cache@v4
3835
with:
3936
path: .next/cache
40-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
41-
restore-keys: |
42-
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
37+
key: ${{ runner.os }}-next-${{ hashFiles('**/pnpm-lock.yaml') }}
4338

4439
- run: pnpm install --frozen-lockfile
4540
- run: pnpm build

0 commit comments

Comments
 (0)