Skip to content

Commit 7f9c94b

Browse files
committed
ci
1 parent 5bc0730 commit 7f9c94b

File tree

4 files changed

+59
-4
lines changed

4 files changed

+59
-4
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v2
23+
with:
24+
version: 8
25+
26+
- name: Get pnpm store directory
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
30+
31+
- name: Setup pnpm cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.STORE_PATH }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Build
43+
run: pnpm run build
44+
45+
- name: Type Check
46+
run: pnpm run typecheck
47+
48+
- name: Lint
49+
run: pnpm run lint
50+
51+
- name: Test
52+
run: pnpm run test

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
"build": "pnpm -r build",
66
"test": "pnpm -r test",
77
"lint": "pnpm -r lint",
8+
"typecheck": "pnpm -r typecheck",
89
"bench": "pnpm --filter d2ts-benchmark bench"
910
},
1011
"devDependencies": {
1112
"typescript": "^5.0.0",
1213
"vitest": "^1.0.0",
1314
"@eslint/js": "latest",
14-
"@typescript-eslint/eslint-plugin": "latest",
15-
"@typescript-eslint/parser": "latest",
15+
"@typescript-eslint/eslint-plugin": "^7.0.0",
16+
"@typescript-eslint/parser": "^7.0.0",
1617
"eslint": "^9.0.0",
1718
"eslint-config-prettier": "^9.0.0"
1819
}

packages/d2ts-benchmark/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"version": "0.0.1",
55
"scripts": {
6-
"bench": "tsx src/index.ts"
6+
"bench": "tsx src/index.ts",
7+
"typecheck": "tsc --noEmit"
78
},
89
"devDependencies": {
910
"@types/benchmark": "^2.1.5",

packages/d2ts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
},
1717
"scripts": {
1818
"build": "tsc",
19-
"test": "vitest",
19+
"test": "vitest run",
2020
"lint": "eslint './src/**/*.ts' './tests/**/*.ts' --config eslint.config.mjs",
2121
"lint:fix": "eslint src/**/*.ts tests/**/*.ts --fix",
22+
"typecheck": "tsc --noEmit",
2223
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\" \"tests/**/*.{ts,tsx,js,jsx,json}\"",
2324
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json}\" \"tests/**/*.{ts,tsx,js,jsx,json}\""
2425
},

0 commit comments

Comments
 (0)