Skip to content

Commit 63ed044

Browse files
authored
build: simplify CI checks (#28)
Co-authored by OpenCode
1 parent 44e859f commit 63ed044

File tree

4 files changed

+39
-58
lines changed

4 files changed

+39
-58
lines changed

.github/actions/setup-node-dependency/action.yml renamed to .github/actions/setup-node-deps/action.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,3 @@ runs:
1616
- name: Set up project
1717
shell: bash
1818
run: pnpm install
19-
20-
- name: Set up infra
21-
shell: bash
22-
run: |
23-
cd infra
24-
pnpm install

.github/workflows/pull-request.yml

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,28 @@ on:
66
- master
77

88
jobs:
9-
lint:
9+
ci-checks:
10+
name: CI Check (${{ matrix.name }})
1011
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v4
14-
15-
- name: Set up project
16-
uses: ./.github/actions/setup-node-deps
17-
18-
- name: Run linting
19-
run: pnpm lint
20-
21-
test:
22-
runs-on: ubuntu-latest
23-
steps:
24-
- name: Checkout code
25-
uses: actions/checkout@v4
26-
27-
- name: Set up project
28-
uses: ./.github/actions/setup-node-deps
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- name: lint
17+
command: ci
18+
- name: test
19+
command: test:run
20+
- name: typecheck
21+
command: typecheck
22+
- name: build
23+
command: build
2924

30-
- name: Run tests
31-
run: pnpm test
32-
33-
typecheck:
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v4
38-
39-
- name: Set up project
40-
uses: ./.github/actions/setup-node-deps
41-
42-
- name: Run typecheck
43-
run: pnpm typecheck
44-
45-
build:
46-
runs-on: ubuntu-latest
4725
steps:
4826
- name: Checkout code
4927
uses: actions/checkout@v4
5028

5129
- name: Set up project
5230
uses: ./.github/actions/setup-node-deps
5331

54-
- name: Run build
55-
run: pnpm build
32+
- name: Run ${{ matrix.name }}
33+
run: pnpm run ${{ matrix.command }}

vite.config.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,4 @@ export default defineConfig({
2727
}),
2828
cloudflare(),
2929
],
30-
test: {
31-
globals: true,
32-
environment: 'jsdom',
33-
setupFiles: ['src/setup-tests.ts'],
34-
coverage: {
35-
provider: 'v8',
36-
enabled: !!process.env.CI,
37-
exclude: ['styled-system', '**/*.config.*', '**/*.d.ts'],
38-
include: ['src/resume/**', 'src/icons/**'],
39-
},
40-
typecheck: {
41-
enabled: true,
42-
},
43-
},
4430
});

vitest.config.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineConfig, mergeConfig } from 'vitest/config';
2+
import viteConfig from './vite.config';
3+
4+
// https://vitejs.dev/config/
5+
export default mergeConfig(
6+
viteConfig,
7+
defineConfig({
8+
test: {
9+
globals: true,
10+
environment: 'jsdom',
11+
setupFiles: ['src/setup-tests.ts'],
12+
coverage: {
13+
provider: 'v8',
14+
enabled: !!process.env.CI,
15+
exclude: ['styled-system', '**/*.config.*', '**/*.d.ts'],
16+
include: ['src/resume/**', 'src/icons/**'],
17+
},
18+
typecheck: {
19+
enabled: true,
20+
},
21+
},
22+
})
23+
);

0 commit comments

Comments
 (0)