Skip to content

Commit ae50352

Browse files
committed
chore(tests): bun coverage reports
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 835cc46 commit ae50352

File tree

4 files changed

+69
-8
lines changed

4 files changed

+69
-8
lines changed

.codecov.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
---
55
codecov:
66
notify:
7-
after_n_builds: 5
7+
after_n_builds: 7
88
wait_for_ci: true
99
require_ci_to_pass: true
1010

1111
comment:
12-
after_n_builds: 5
12+
after_n_builds: 7
1313
behavior: default
1414
layout: header,diff,flags,components,tree,footer
1515
require_base: false
@@ -32,6 +32,10 @@ component_management:
3232
name: errors
3333
paths:
3434
- src/errors/*.mts
35+
- component_id: events
36+
name: events
37+
paths:
38+
- src/events/*.mts
3539
- component_id: internal
3640
name: internal
3741
paths:
@@ -40,6 +44,10 @@ component_management:
4044
name: lib
4145
paths:
4246
- src/lib/*.mts
47+
- component_id: parsers
48+
name: parsers
49+
paths:
50+
- src/parsers/*.mts
4351
- component_id: utils
4452
name: utils
4553
paths:
@@ -92,6 +100,14 @@ coverage:
92100
threshold: 0%
93101

94102
flags:
103+
bun-canary:
104+
carryforward: false
105+
paths:
106+
- src/
107+
bun-latest:
108+
carryforward: false
109+
paths:
110+
- src/
95111
node24:
96112
carryforward: false
97113
paths:

.github/infrastructure.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ branches:
2525
- context: artifacts
2626
- context: auto-merge
2727
- context: auto-review
28+
- context: codecov/changes
29+
- context: codecov/patch
30+
- context: codecov/project
31+
- context: codecov/project/constructs
32+
- context: codecov/project/errors
33+
- context: codecov/project/events
34+
- context: codecov/project/internal
35+
- context: codecov/project/lib
36+
- context: codecov/project/parsers
37+
- context: codecov/project/utils
2838
- context: commitlint
2939
- context: dependabot-dedupe
3040
- context: format
@@ -37,7 +47,6 @@ branches:
3747
- context: test (20)
3848
- context: test-bun (canary)
3949
- context: test-bun (latest)
40-
- context: test-bun (1.2.0)
4150
- context: typescript
4251
strict: true
4352
restrictions: null

.github/workflows/ci.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ permissions:
4343
contents: read
4444
env:
4545
CACHE_PATH: node_modules
46+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4647
COVERAGE_SUMMARY: ./coverage/coverage-summary.json
4748
HUSKY: 0
4849
PCT: .total.branches.pct + .total.functions.pct + .total.lines.pct + .total.statements.pct
@@ -253,8 +254,6 @@ jobs:
253254
- 22
254255
- 21
255256
- 20
256-
env:
257-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
258257
steps:
259258
- id: checkout
260259
name: Checkout ${{ env.REF_NAME }}
@@ -305,7 +304,7 @@ jobs:
305304
disable_search: true
306305
env_vars: GITHUB_JOB,GITHUB_REF_TYPE
307306
fail_ci_if_error: true
308-
files: ./__tests__/reports/junit.xml
307+
files: ./__tests__/reports/test.junit.xml
309308
flags: ${{ format('node{0}', matrix.node-version) }}
310309
name: ${{ format('{0}.node{1}', env.SHA, matrix.node-version) }}
311310
override_branch: ${{ env.REF_NAME }}
@@ -336,7 +335,6 @@ jobs:
336335
bun-version:
337336
- canary
338337
- latest
339-
- 1.2.0
340338
steps:
341339
- id: checkout
342340
name: Checkout ${{ env.REF_NAME }}
@@ -364,6 +362,44 @@ jobs:
364362
with:
365363
data: ${{ env.COVERAGE_SUMMARY }}
366364
filter: "'${{ env.PCT }}'"
365+
- id: report
366+
name: Upload report
367+
uses: actions/[email protected]
368+
with:
369+
name: ${{ format('{0}.bun-{1}.blob.json', env.SHA, matrix.bun-version) }}
370+
path: ./.vitest-reports/test.blob.json
371+
- id: coverage-summary
372+
name: Upload coverage summary
373+
uses: actions/[email protected]
374+
with:
375+
name: ${{ format('{0}.bun-{1}.coverage.json', env.SHA, matrix.bun-version) }}
376+
path: ${{ env.COVERAGE_SUMMARY }}
377+
- id: codecov-results
378+
if: ${{ !cancelled() }}
379+
name: Upload test results to Codecov
380+
uses: codecov/[email protected]
381+
with:
382+
disable_search: true
383+
env_vars: GITHUB_JOB,GITHUB_REF_TYPE
384+
fail_ci_if_error: true
385+
files: ./__tests__/reports/test.junit.xml
386+
flags: ${{ format('bun-{0}', matrix.bun-version) }}
387+
name: ${{ format('{0}.bun-{1}', env.SHA, matrix.bun-version) }}
388+
override_branch: ${{ env.REF_NAME }}
389+
verbose: true
390+
- id: codecov-coverage
391+
name: Upload coverage report to Codecov
392+
uses: codecov/[email protected]
393+
with:
394+
disable_file_fixes: true
395+
disable_search: true
396+
env_vars: GITHUB_JOB,GITHUB_REF_TYPE
397+
fail_ci_if_error: true
398+
files: ./coverage/lcov.info
399+
flags: ${{ format('bun-{0}', matrix.bun-version) }}
400+
name: ${{ format('{0}.bun-{1}', env.SHA, matrix.bun-version) }}
401+
override_branch: ${{ env.REF_NAME }}
402+
verbose: true
367403
- id: coverage-failure
368404
if: fromJson(steps.coverage.outputs.result) != 400
369405
name: Coverage threshold failure (${{ steps.coverage.outputs.result }})

vitest.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function config(this: void, env: ConfigEnv): ViteUserConfig {
7575
outputFile: {
7676
blob: pathe.join('.vitest-reports', env.mode + '.blob.json'),
7777
json: pathe.join('__tests__', 'reports', env.mode + '.json'),
78-
junit: pathe.join('__tests__', 'reports', 'junit.xml')
78+
junit: pathe.join('__tests__', 'reports', env.mode + '.junit.xml')
7979
},
8080
passWithNoTests: true,
8181
reporters: JSON.parse(process.env['VITEST_UI'] ?? '0')

0 commit comments

Comments
 (0)