diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5edf76c7..598c1db2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,9 @@ concurrency: group: ${{ github.workflow }} jobs: test: + permissions: + checks: write + pull-requests: write runs-on: ubuntu-latest steps: - name: Harden Runner @@ -35,3 +38,9 @@ jobs: - name: Run coverage run: npm test -- --coverage - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + - name: Publish Test Results + uses: step-security/publish-unit-test-result-action@v1 + if: always() + with: + files: | + reports/*.xml diff --git a/.gitignore b/.gitignore index ac65aa60..669d24ae 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ lib-cov # Coverage directory used by tools like istanbul coverage +reports *.lcov # nyc test coverage diff --git a/jest.config.ts b/jest.config.ts index e5841e93..61b68a18 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,5 +1,9 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ export default { - preset: 'ts-jest', - testEnvironment: 'node', + preset: "ts-jest", + testEnvironment: "node", + reporters: [ + "default", + ["jest-junit", { outputDirectory: "reports", outputName: "report.xml" }], + ], };