From 1770c5408e8e6c88a487285baa2059151203b098 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 21 Jan 2025 09:32:37 +0900 Subject: [PATCH] Set up Codecov test reports --- .circleci/config.yml | 6 ++++++ .github/workflows/test-win.yml | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f43abba..6f6b354a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,6 +99,7 @@ commands: name: Jest command: npm run test:coverage -- --ci --reporters=default --reporters=jest-junit <<# parameters.runInBand >>-i<> environment: + JEST_JUNIT_CLASSNAME: '{filepath}' JEST_JUNIT_OUTPUT_DIR: tmp/test-results MARP_TEST_CI: 1 @@ -108,6 +109,11 @@ commands: - store_test_results: path: tmp/test-results + - codecov/upload: + flags: linux + report_type: test_results + dir: tmp/test-results + - store_artifacts: path: ./coverage destination: coverage diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index c08745d3..f0c5963b 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -48,12 +48,14 @@ jobs: # https://stackoverflow.com/a/59365905 - name: Jest env: + JEST_JUNIT_CLASSNAME: '{filepath}' + JEST_JUNIT_OUTPUT_DIR: tmp/test-results MARP_TEST_CI: 1 run: >- npm run test:coverage -- --ci --max-workers ${{ steps.cpu-cores.outputs.count }} --reporters=default --reporters=jest-junit || - npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache || - npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache || - npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache + npm run test:coverage -- --ci --bail -i --reporters=default --reporters=jest-junit --no-cache || + npm run test:coverage -- --ci --bail -i --reporters=default --reporters=jest-junit --no-cache || + npm run test:coverage -- --ci --bail -i --reporters=default --reporters=jest-junit --no-cache - uses: actions/upload-artifact@v4 with: @@ -64,3 +66,8 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: windows + + - uses: codecov/test-results-action@v1 + if: ${{ !cancelled() }} + with: + token: ${{ secrets.CODECOV_TOKEN }}