diff --git a/.github/workflows/tests-coverage.yml b/.github/workflows/tests-coverage.yml index 460539c..3a29168 100644 --- a/.github/workflows/tests-coverage.yml +++ b/.github/workflows/tests-coverage.yml @@ -1,30 +1,20 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Tests CI - +name: Test with Coverage report on: - pull_request: - branches: ['main', 'develop'] + pull_request: + branches: + - develop + - main jobs: - build: - name: Run Coverage Tests - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x] - - steps: - - name: Checkout Branch To Runner - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'yarn' - - name: Install Yarn - run: yarn install --prefer-offline --immutable - - name: Run Coverage Tests - run: yarn run test:ci + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout Branch To Runner + uses: actions/checkout@v3 + + - name: Jest coverage report + uses: ArtiomTr/jest-coverage-report-action@v2.2.1 + with: + package-manager: yarn + test-script: yarn test:ci + annotations: all diff --git a/.gitignore b/.gitignore index 436b302..da7239e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules /.cache /build /public/build +/coverage .env package-lock.json diff --git a/jest.config.js b/jest.config.js index 1928e8d..c862435 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,6 +6,7 @@ module.exports = { '^.+\\.(t|j)sx?$': 'ts-jest', }, setupFilesAfterEnv: ['./jest.setup.js'], + reporters: [['github-actions', { silent: false }], 'summary'], coverageThreshold: { global: { branches: 100, diff --git a/package.json b/package.json index e9c8824..123e464 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "start": "remix-serve build", "prepare": "husky install", "test": "jest", - "test:ci": "jest --coverage --silent --ci", + "test:ci": "jest --ci --json --coverage --testLocationInResults --outputFile=report.json", "sb": "start-storybook -p 6006", "build-sb": "build-storybook" },