From 6be7cb293711e2ead0ee8fa9b2857ce15d1fabf8 Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Fri, 8 Mar 2024 11:49:43 -0500 Subject: [PATCH] ci(workflows): update badge --- .github/workflows/coverage.yaml | 4 ++-- package.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 597fcb5..e2a21d0 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -27,7 +27,7 @@ jobs: - name: Build run: npm run build - name: Test - run: npm run test + run: npm run test:badge # Only run the coverage once - name: Get Coverage for badge @@ -44,7 +44,7 @@ jobs: # ]; # SUMMARY = SUMMARY.split('\n')[5]; // 'Lines : 31.93% ( 38/119 )' # SUMMARY = SUMMARY.split(':')[1].split('(')[0].trim(); // '31.93%' - SUMMARY="$(npm run test | tail -2 | head -1)" + SUMMARY="$(npm run test:badge | tail -2 | head -1)" TOKENS=($SUMMARY) # process.env.COVERAGE = '31.93%'; echo "COVERAGE=$(echo ${TOKENS[2]})" >> $GITHUB_ENV diff --git a/package.json b/package.json index ee2e444..2b57c8f 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "prepare": "husky install", "test": "vitest --dom --run --coverage", "test:changed": "npm run test -- --changed", + "test:badge": "vitest run --coverage.enabled --coverage.reporter='text-summary'", "test:ci": "npm run test -- --silent", "typecheck": "vue-tsc", "badges": "run-p badges:*",