From 48c355a66707a7fd90002e108d504314a4e6d279 Mon Sep 17 00:00:00 2001 From: Surmon Date: Thu, 15 Aug 2024 02:44:21 +0800 Subject: [PATCH] ci: add test results to action --- .github/workflows/coverage.yml | 9 ++++++++- .gitignore | 2 ++ package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 636e46e..47da475 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,9 +22,16 @@ jobs: - name: Install dependencies run: pnpm install - - name: Test + - name: Test results & coverage run: pnpm run test:coverage + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./junit.xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.gitignore b/.gitignore index 82d7b9f..44d7873 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,10 @@ node_modules package-lock.json npm-debug.log + # output dist # Test Relative Folders coverage +junit.xml diff --git a/package.json b/package.json index bce8a77..cb33e4f 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "format": "prettier --write --parser typescript \"src/**/*.ts\"", "test": "vitest run", "test:watch": "vitest watch", - "test:coverage": "vitest run --coverage", + "test:coverage": "vitest run --coverage --reporter=junit --outputFile=./junit.xml", "ci": "npm run lint && npm run test && npm run build", "release": ". ./scripts/release.sh" },