Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: github action #179

Merged
merged 6 commits into from
Nov 7, 2024
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
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -36,10 +36,12 @@ jobs:
filename: ./coverage/cobertura-coverage.xml
format: markdown
output: both
if: matrix.node-version == '22.x'
- name: Write PR meta to file
run: |
echo "PR_HEADSHA=${{ github.event.pull_request.head.sha }}" >> pr.env
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> pr.env
if: matrix.node-version == '22.x'
- name: Upload PR meta and Coverage summery artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -48,7 +50,9 @@ jobs:
pr.env
code-coverage-results.md
retention-days: 1
if: matrix.node-version == '22.x'
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.node-version == '22.x'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"build": "tsup src/index.ts",
"typescript": "tsc --noEmit",
"prepublishOnly": "npm run build",
"test": "vitest",
"test": "vitest --watch=false --coverage",
"update-test-snapshot": "NODE_OPTIONS='--no-warnings --loader=@esbuild-kit/esm-loader' c8 ava --update-snapshots --serial"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
testTimeout: 10_000,
coverage: {
include: ['src/**'],
provider: 'v8' as const,
reporter: ['text', 'cobertura'],
thresholds: {
branches: 100,
functions: 100,
Expand Down
Loading