Skip to content

Commit 076d4da

Browse files
yangshunclaude
andcommitted
Add GitHub Actions CI workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b8719b8 commit 076d4da

File tree

4 files changed

+51
-9
lines changed

4 files changed

+51
-9
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: pnpm/action-setup@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
cache: pnpm
21+
22+
- run: pnpm install --frozen-lockfile
23+
24+
- run: pnpm check

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"oxfmt": "^0.36.0",
5757
"oxlint": "^1.51.0",
5858
"tsdown": "^0.21.0",
59+
"tsx": "^4.21.0",
5960
"typescript": "^5.9.3",
6061
"vitest": "^4.0.18"
6162
},

pnpm-lock.yaml

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/cli.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { execFile } from 'child_process';
22
import path from 'path';
33
import { describe, expect, test } from 'vitest';
44

5-
const CLI_PATH = path.resolve(__dirname, '../../dist/cli.cjs');
5+
const TSX_PATH = path.resolve(__dirname, '../../node_modules/.bin/tsx');
6+
const CLI_PATH = path.resolve(__dirname, '../cli.ts');
67
const FIXTURES_PATH = path.join(__dirname, '__fixtures__');
78

89
function run(
910
args: string[] = [],
1011
): Promise<{ stdout: string; stderr: string; exitCode: number }> {
1112
return new Promise((resolve) => {
12-
execFile('node', [CLI_PATH, ...args], (error, stdout, stderr) => {
13+
execFile(TSX_PATH, [CLI_PATH, ...args], (error, stdout, stderr) => {
1314
resolve({
1415
stdout: stdout.trimEnd(),
1516
stderr: stderr.trimEnd(),

0 commit comments

Comments
 (0)