Skip to content

Commit d4f7bde

Browse files
committed
Add GitHub Actions CI and fix typecheck errors
- Add CI workflow with lint, format check, typecheck, and tests - Remove orphaned setPendingNotification calls in view.tsx - Fix version test to read from package.json - Add typecheck script to package.json
1 parent 538ba4e commit d4f7bde

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
19+
- run: bun install --frozen-lockfile
20+
21+
- name: Lint
22+
run: bun run lint
23+
24+
- name: Format check
25+
run: bun run format:check
26+
27+
- name: Typecheck
28+
run: bun --bun tsc --noEmit
29+
30+
- name: Test
31+
run: bun test

commands/view.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,6 @@ function App() {
16171617

16181618
const notification = mergeNotification
16191619
setMergeNotification(null)
1620-
setPendingNotification(notification)
16211620

16221621
// Start the sync operation
16231622
const result = await performSync(
@@ -1689,7 +1688,6 @@ function App() {
16891688
await $`git rebase --abort`.quiet().nothrow()
16901689
await $`git checkout ${conflictState.originalBranch}`.quiet().nothrow()
16911690
setConflictState(null)
1692-
setPendingNotification(null)
16931691

16941692
// Reload current branch
16951693
const branch = await getCurrentBranch()

index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, test, expect } from 'bun:test'
22
import { $ } from 'bun'
3+
import pkg from './package.json'
34

45
describe('CLI integration', () => {
56
test('--help shows usage', async () => {
@@ -15,7 +16,7 @@ describe('CLI integration', () => {
1516

1617
test('--version shows version', async () => {
1718
const result = await $`bun index.ts --version`.quiet()
18-
expect(result.stdout.toString()).toContain('0.1.0')
19+
expect(result.stdout.toString()).toContain(pkg.version)
1920
})
2021

2122
test('new --help shows branch argument', async () => {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"lint:fix": "oxlint --fix .",
3838
"format": "oxfmt --write .",
3939
"format:check": "oxfmt --check .",
40-
"check": "bun run lint && bun run format:check"
40+
"typecheck": "tsc --noEmit",
41+
"check": "bun run lint && bun run format:check && bun run typecheck"
4142
},
4243
"dependencies": {
4344
"@effect/cli": "^0.73.1",

scripts/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function parseVersion(version: string): [number, number, number] {
2020
if (!match) {
2121
throw new Error(`Invalid version format: ${version}`)
2222
}
23-
return [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])]
23+
return [parseInt(match[1]!), parseInt(match[2]!), parseInt(match[3]!)]
2424
}
2525

2626
function bumpVersion(version: string, bump: BumpType): string {

0 commit comments

Comments
 (0)