Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/code-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,22 @@ jobs:
}
- name: Validate
id: validate
run: bun run validate
run: bun run validate:coverage
- name: Upload coverage to Codecov
if: always() && steps.validate.outcome == 'success'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: false
- name: Upload test results to Codecov
if: always() && steps.validate.outcome != 'skipped'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/junit.xml
report-type: test_results
fail_ci_if_error: false
- name: Save Bun Cache
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
if: steps.validate.outcome == 'success' && steps.restore-bun-cache.outputs.cache-hit != 'true'
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,22 @@ jobs:
run: bun install --frozen-lockfile
- name: Validate
id: validate
run: bun run validate
run: bun run validate:coverage
- name: Upload coverage to Codecov
if: always() && steps.validate.outcome == 'success'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: false
- name: Upload test results to Codecov
if: always() && steps.validate.outcome != 'skipped'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/junit.xml
report-type: test_results
fail_ci_if_error: false
- name: Ensure main is up-to-date before release
run: git pull --rebase origin main
- name: Release
Expand Down
2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ saveTextLockfile = true

[test]
preload = ["./tests/preload.ts"]
coverageReporter = ["lcov", "text"]
coverageDir = "coverage"
25 changes: 25 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
codecov:
require_ci_to_pass: true

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: 80%

comment:
layout: "header, diff, flags, components"
behavior: default
require_changes: true
require_base: false
require_head: true

ignore:
- "docs/**"
- "scripts/**"
- "tests/**"
- ".archgate/**"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
"lint": "oxlint --deny-warnings .",
"postinstall": "node scripts/postinstall.cjs",
"test": "bun test --timeout 60000",
"test:coverage": "bun test --timeout 60000 --coverage --reporter=junit --reporter-outfile=coverage/junit.xml",
"test:watch": "bun test --watch --timeout 60000",
"typecheck": "tsc --build",
"validate": "bun run lint && bun run typecheck && bun run format:check && bun run test && bun run check && bun run build:check"
"validate": "bun run lint && bun run typecheck && bun run format:check && bun run test && bun run check && bun run build:check",
"validate:coverage": "bun run lint && bun run typecheck && bun run format:check && bun run test:coverage && bun run check && bun run build:check"
},
"devDependencies": {
"@commander-js/extra-typings": "14.0.0",
Expand Down
Loading