Skip to content

Commit 514b149

Browse files
committed
ci: add github workflows and commitlint
1 parent 6c3eb90 commit 514b149

9 files changed

Lines changed: 290 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Install Dependencies
2+
description: Setup Bun and install dependencies with frozen lockfile
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: oven-sh/setup-bun@v2
8+
with:
9+
bun-version: latest
10+
11+
- name: Install dependencies
12+
shell: bash
13+
run: bun install --frozen-lockfile

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types: [opened, reopened, synchronize, ready_for_review]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
name: TypeScript
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
uses: ./.github/actions/install-dependencies
23+
24+
- name: Build
25+
run: bun run build

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types: [opened, reopened, synchronize, ready_for_review]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Biome
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
uses: ./.github/actions/install-dependencies
23+
24+
- name: Check
25+
run: bun run check

.github/workflows/pr-lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PR Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review, edited]
6+
7+
jobs:
8+
pr-lint:
9+
name: Commitlint
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install dependencies
16+
uses: ./.github/actions/install-dependencies
17+
18+
- name: Lint PR title
19+
run: echo "${{ github.event.pull_request.title }}" | bun commitlint

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types: [opened, reopened, synchronize, ready_for_review]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
name: Vitest
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
uses: ./.github/actions/install-dependencies
23+
24+
- name: Test
25+
run: bun run test

CLAUDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ Default to using Bun instead of Node.js.
99
- Bun automatically loads .env, so don't use dotenv.
1010

1111

12+
## Code Style
13+
14+
Always refer to `biome.json` for coding style rules — indentation, quotes, semicolons, import order, and lint rules are all defined there. Do not deviate from them.
15+
16+
After writing or modifying any code, always run:
17+
18+
```bash
19+
bun run check
20+
```
21+
22+
This formats and lints in one pass. Fix any errors before considering the task done.
23+
24+
## Build
25+
26+
After writing or modifying any code, always run:
27+
28+
```bash
29+
bun run build
30+
```
31+
32+
Resolve any TypeScript errors before finishing. Do not leave the build in a broken state.
33+
1234
## Documentation
1335

1436
Always use Context7 (`mcp__context7__resolve-library-id` + `mcp__context7__query-docs`) for library/API documentation, code generation, and setup or configuration steps without waiting for an explicit ask.

bun.lock

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

commitlint.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { UserConfig } from '@commitlint/types';
2+
3+
const config: UserConfig = {
4+
extends: ['@commitlint/config-conventional'],
5+
};
6+
7+
export default config;

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
"lint": "biome lint --write .",
77
"format": "biome format --write .",
88
"check": "biome check --write .",
9+
"build": "tsc --noEmit",
10+
"test": "vitest run",
911
"release": "changeset publish",
1012
"version": "changeset version"
1113
},
1214
"devDependencies": {
1315
"@biomejs/biome": "2.4.9",
1416
"@changesets/cli": "2.30.0",
17+
"@commitlint/cli": "^20.5.0",
18+
"@commitlint/config-conventional": "^20.5.0",
1519
"@types/bun": "latest",
1620
"vitest": "^4.1.2"
1721
},

0 commit comments

Comments
 (0)