From 3d65d2e733f8e589305481af1cf7138173853d5b Mon Sep 17 00:00:00 2001 From: Daniil Suvorov Date: Thu, 26 Dec 2024 11:12:53 +0300 Subject: [PATCH] ci(test): fix coverage file (#1147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Используем обычный json для покрытия, вместо junit --- .github/workflows/reusable_workflow_test.yml | 7 +++++-- .gitignore | 1 + package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable_workflow_test.yml b/.github/workflows/reusable_workflow_test.yml index b74d2c3a1..00b963143 100644 --- a/.github/workflows/reusable_workflow_test.yml +++ b/.github/workflows/reusable_workflow_test.yml @@ -25,13 +25,16 @@ jobs: run: yarn run test:ci - name: Upload test artifact + if: always() uses: actions/upload-artifact@v4 with: name: test-output path: | - junit.xml + test-results.json + .nyc_output/coverage-final.json deploy_test_coverage: + if: ${{ !cancelled() && (success() || failure()) }} needs: test runs-on: ubuntu-latest permissions: @@ -49,5 +52,5 @@ jobs: uses: codecov/codecov-action@v5 with: use_oidc: true - files: junit.xml + files: .nyc_output/coverage-final.json fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index 6e83cdb58..d5a7a547e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ docs/src/**/*.d.ts docs/public/**/*.json docs/dist/ !.husky +test-results.json diff --git a/package.json b/package.json index fd50bc19a..f26994662 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "tsc:dist": "tsc --project tsconfig.publish.json", "tsc:generate-paths": "tscpaths -p tsconfig.tscpaths.json -s ./dist -o ./dist", "test": "jest --coverage", - "test:ci": "jest --coverage --verbose --reporters=\"jest-junit\" --reporters=\"default\"", + "test:ci": "jest --ci --silent --outputFile test-results.json --json --coverage --coverageReporters='json' --coverageDirectory='.nyc_output'", "clear:src": "find src -name '*.d.ts' -delete && find src -name '*.js' -delete", "clear:dist": "find dist -regex '.*[^d]\\.ts' -delete", "open:coverage": "open .coverage/index.html",