Skip to content

Commit 77f9c3e

Browse files
committed
fix(ci): Update CI workflow to use npm/Jest instead of Bun
The CI workflow was configured for Bun but we're using npm and Jest. This was causing test and coverage upload failures. ## Changes **CI Workflow (.github/workflows/ci.yml):** - Replace all Bun setup with Node.js v20.x setup - Use npm ci instead of bun install for faster, consistent installs - Update all job commands to use npm scripts - Fix test job to use npm run test:coverage on ubuntu - Update Codecov upload to look for lcov.info instead of coverage-final.json - Add fail_ci_if_error: false to make Codecov non-blocking - Add verbose: true for better debugging **Jest Config (jest.config.js):** - Add explicit coverageReporters: ['text', 'lcov', 'json-summary'] - Add coverageDirectory: 'coverage' for clarity - This ensures lcov.info is generated for Codecov ## Why The original workflow used Bun throughout, but: 1. We're using npm with Jest for testing (see package.json) 2. Bun commands were failing because test setup uses Jest 3. Coverage file was not in expected location/format This fix ensures: - All CI jobs use consistent tooling (npm/Node.js) - Coverage is properly generated and uploaded - Tests run correctly across all platforms
1 parent b38eafa commit 77f9c3e

2 files changed

Lines changed: 37 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,20 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
1919

20-
- name: Setup Bun
21-
uses: oven-sh/setup-bun@v1
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
2222
with:
23-
bun-version: latest
23+
node-version: '20.x'
24+
cache: 'npm'
2425

2526
- name: Install dependencies
26-
run: bun install
27+
run: npm ci
2728

2829
- name: Run ESLint
29-
run: bun run lint
30+
run: npm run lint
3031

3132
- name: Check formatting
32-
run: bun run format:check
33+
run: npm run format:check
3334

3435
type-check:
3536
name: Type Check
@@ -38,50 +39,55 @@ jobs:
3839
- name: Checkout code
3940
uses: actions/checkout@v4
4041

41-
- name: Setup Bun
42-
uses: oven-sh/setup-bun@v1
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
4344
with:
44-
bun-version: latest
45+
node-version: '20.x'
46+
cache: 'npm'
4547

4648
- name: Install dependencies
47-
run: bun install
49+
run: npm ci
4850

4951
- name: Run TypeScript compiler
50-
run: bun run type-check
52+
run: npm run type-check
5153

5254
test:
5355
name: Test
5456
runs-on: ${{ matrix.os }}
5557
strategy:
5658
matrix:
5759
os: [ubuntu-latest, macos-latest, windows-latest]
58-
bun-version: [latest]
60+
node-version: ['20.x']
5961
steps:
6062
- name: Checkout code
6163
uses: actions/checkout@v4
6264

63-
- name: Setup Bun
64-
uses: oven-sh/setup-bun@v1
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v4
6567
with:
66-
bun-version: ${{ matrix.bun-version }}
68+
node-version: ${{ matrix.node-version }}
69+
cache: 'npm'
6770

6871
- name: Install dependencies
69-
run: bun install
72+
run: npm ci
7073

71-
- name: Run tests
72-
run: bun test
73-
74-
- name: Generate coverage report
74+
- name: Run tests with coverage
7575
if: matrix.os == 'ubuntu-latest'
76-
run: bun test --coverage
76+
run: npm run test:coverage
77+
78+
- name: Run tests without coverage
79+
if: matrix.os != 'ubuntu-latest'
80+
run: npm test
7781

7882
- name: Upload coverage to Codecov
7983
if: matrix.os == 'ubuntu-latest'
8084
uses: codecov/codecov-action@v4
8185
with:
82-
file: ./coverage/coverage-final.json
86+
files: ./coverage/lcov.info
8387
flags: unittests
8488
name: codecov-umbrella
89+
fail_ci_if_error: false
90+
verbose: true
8591

8692
build:
8793
name: Build
@@ -91,19 +97,20 @@ jobs:
9197
- name: Checkout code
9298
uses: actions/checkout@v4
9399

94-
- name: Setup Bun
95-
uses: oven-sh/setup-bun@v1
100+
- name: Setup Node.js
101+
uses: actions/setup-node@v4
96102
with:
97-
bun-version: latest
103+
node-version: '20.x'
104+
cache: 'npm'
98105

99106
- name: Install dependencies
100-
run: bun install
107+
run: npm ci
101108

102109
- name: Build project
103-
run: bun run build
110+
run: npm run build
104111

105112
- name: Build type declarations
106-
run: bun run build:types
113+
run: npm run build:types
107114

108115
- name: Upload build artifacts
109116
uses: actions/upload-artifact@v4

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module.exports = {
1313
'!src/**/*.spec.ts',
1414
'!src/**/__tests__/**',
1515
],
16+
coverageReporters: ['text', 'lcov', 'json-summary'],
17+
coverageDirectory: 'coverage',
1618
coverageThreshold: {
1719
global: {
1820
branches: 50,

0 commit comments

Comments
 (0)