From 56ede3dd8e45c0a3f4e437247276d7705ba75b44 Mon Sep 17 00:00:00 2001 From: Alina Sireneva Date: Sun, 12 Nov 2023 01:34:35 +0300 Subject: [PATCH] ci: added codecov to test action --- .github/workflows/test.yaml | 14 +++++++++++--- package.json | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 52b286b3..868d094d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,14 +3,15 @@ name: Node.js CI on: push: branches: [ master ] + paths-ignore: + - '*.md' # ignore changes to readmes pull_request: branches: [ master ] -# jobs: test: runs-on: ubuntu-latest - if: github.actor != 'mtcute-bot' # do not after release + if: github.actor != 'mtcute-bot' # do not run after release strategy: matrix: @@ -34,7 +35,14 @@ jobs: run: pnpm run lint:ci - name: 'Circular dependencies' run: pnpm run lint:dpdm - - run: pnpm run test + - run: pnpm run test:ci + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + if: ${{ matrix.node-version == '18.x' }} # to avoid uploading twice + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: ./coverage/coverage-final.json e2e: runs-on: ubuntu-latest needs: test diff --git a/package.json b/package.json index 7eedcb61..b9369eae 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "test:dev": "vitest watch", "test:ui": "vitest --ui", "test:coverage": "vitest run --coverage", + "test:ci": "vitest run --coverage.enabled --coverage.reporter=json", "lint": "eslint .", "lint:ci": "NODE_OPTIONS=\"--max_old_space_size=8192\" eslint --config .eslintrc.ci.js .", "lint:tsc": "pnpm -r --parallel exec tsc --build",