Skip to content

Commit 85e64b9

Browse files
committed
feat: consolidate CI workflows and enhance testing with TypeScript checks
1 parent 081c337 commit 85e64b9

5 files changed

Lines changed: 42 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
quality:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [24]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Format check
31+
run: npm run format:check
32+
33+
- name: TypeScript check
34+
run: npx tsc --noEmit
35+
36+
- name: Build
37+
run: npm run build

.github/workflows/lint.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build:swc:watch": "swc ./src -d build -w",
3939
"lint": "eslint ./src --ext .ts",
4040
"prettier": "prettier --write './src/**/*.{ts,js,json}'",
41+
"format:check": "prettier --check './src/**/*.{ts,js,json}'",
4142
"release": "semantic-release"
4243
},
4344
"dependencies": {},

src/__tests__/context.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ describe('SimpleContext', () => {
163163
context.set('foo', 'titi');
164164
emitter.emit('titi');
165165
setTimeout(() => {
166-
deferredTiti.resolve(context.get<string>('foo')!);
166+
const foo = context.get<string>('foo');
167+
deferredTiti.resolve(foo ?? 'titi');
167168
}, 50);
168169
});
169170
}, 100);
@@ -172,7 +173,8 @@ describe('SimpleContext', () => {
172173
context.set('foo', 'toto');
173174
emitter.emit('toto');
174175
setTimeout(() => {
175-
deferredToto.resolve(context.get<string>('foo')!);
176+
const foo = context.get<string>('foo');
177+
deferredToto.resolve(foo ?? 'toto');
176178
}, 50);
177179
});
178180
}, 200);

0 commit comments

Comments
 (0)