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
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
verifications:
name: Verifications
uses: ./.github/workflows/verifications.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

required-checks:
name: Require CI status checks
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/main-coverage.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ permissions:
pull-requests: write # to be able to comment on released pull requests

jobs:
verifications:
name: Verifications
uses: ./.github/workflows/verifications.yml

publish:
name: Publish package
runs-on: ubuntu-latest
needs: [verifications]
# Avoid publishing in forks
if: github.repository == 'testing-library/eslint-plugin-testing-library'
steps:
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/verifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Verifications

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: true

permissions:
id-token: write # OIDC auth for Codecov

jobs:
code-validation:
Expand Down Expand Up @@ -65,7 +65,16 @@ jobs:
- name: Run tests
run: pnpm run test:ci

- name: Upload coverage reports to Codecov
- name: Upload tests coverage report
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ !cancelled() && github.event.action != 'closed' }}
with:
use_oidc: true
report_type: 'coverage'

- name: Upload tests result report
uses: codecov/codecov-action@v5
if: ${{ !cancelled() && github.event.action != 'closed' }}
with:
use_oidc: true
report_type: 'test_results'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pids

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
test-report.junit.xml

# Coverage directory used by tools like istanbul
coverage
Expand Down Expand Up @@ -64,6 +65,7 @@ typings/
yarn-error.log
.pnp/
.pnp.js

# Yarn Integrity file
.yarn-integrity

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"semantic-release": "semantic-release",
"test": "vitest run",
"test:ci": "vitest run --coverage",
"test:ui": "vitest --ui",
"test:watch": "vitest",
"type-check": "tsc --noEmit"
},
Expand All @@ -66,6 +67,7 @@
"@typescript-eslint/rule-tester": "^8.15.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/eslint-plugin": "^1.5.2",
"@vitest/ui": "3.2.4",
"del-cli": "^6.0.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
Expand Down
68 changes: 60 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineConfig } from 'vitest/config';
import { defineConfig, configDefaults } from 'vitest/config';

export default defineConfig({
test: {
include: ['**/tests/**/*.test.ts'],
setupFiles: ['./vitest.setup.mts'],
clearMocks: true,
coverage: {
include: ['lib/**'],
thresholds: {
Expand All @@ -13,5 +14,10 @@ export default defineConfig({
statements: 90,
},
},
// Enable JUnit reporter in CI environment
reporters: process.env.CI ? ['default', 'junit'] : configDefaults.reporters,
outputFile: {
junit: 'test-report.junit.xml',
},
},
});