diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f2ed7a..33ae300 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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: @@ -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/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} + if: matrix.node-version == '22.x' diff --git a/package.json b/package.json index 5dd976f..a6c2ce0 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/vitest.config.ts b/vitest.config.ts index 452a30d..a2a613b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -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,