From fb9b680f9e36641f71ef4604b939b528a12c0fe2 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 17:17:48 +0300 Subject: [PATCH 1/2] fix: coverage action not fail when ut fail --- .github/workflows/tests.yaml | 59 ++++++++++++++++++++---------------- package.json | 3 +- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d6d45b371e..06f0d7e85e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -11,29 +11,36 @@ jobs: build-and-unit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: | - npm-${{ hashFiles('package-lock.json') }} - npm- - - name: Install modules - run: | - echo - echo Using Node $(node -v), NPM $(npm -v) - echo - npm ci - - name: Unit Tests & Coverage Report - uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 - env: - CI: true - with: - annotations: none - test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage || exit 0 - - name: E2E Tests - run: npm run e2e - env: - CI: true + - uses: actions/checkout@v3 + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ hashFiles('package-lock.json') }} + npm- + - name: Install modules + run: | + echo + echo Using Node $(node -v), NPM $(npm -v) + echo + - name: Install dependencies + run: npm ci + env: + CI: true + - name: Typecheck + run: npm run typecheck + - name: Unit Tests + run: npm run jest -- --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage + - name: Coverage Report + uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 + with: + skip-step: none + coverage-file: report.json + annotations: none + test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report-base.json --bail --coverage + - name: E2E Tests + run: npm run e2e + env: + CI: true diff --git a/package.json b/package.json index 8835552ff9..aa0fc89748 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "engineStrict": true, "scripts": { "test": "npm run typecheck && npm run unit", - "unit": "jest ./packages --coverage --coverageReporters lcov text-summary", + "jest": "jest ./packages", + "unit": "npm run jest -- --coverage --coverageReporters lcov text-summary", "coverage:cli": "jest --roots packages/cli/src --coverage", "coverage:core": "jest --roots packages/core/src --coverage", "typecheck": "tsc --noEmit --skipLibCheck", From b1a3a21bccc6dfa8620797e271e73670c7f6817a Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 17:41:10 +0300 Subject: [PATCH 2/2] chore: test coverage failure --- .github/workflows/tests.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 06f0d7e85e..4bc8f0ce65 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,15 +31,12 @@ jobs: CI: true - name: Typecheck run: npm run typecheck - - name: Unit Tests - run: npm run jest -- --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 with: skip-step: none - coverage-file: report.json annotations: none - test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report-base.json --bail --coverage + test-script: npm run jest -- --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: E2E Tests run: npm run e2e env: