switch coverage to codecov

This commit is contained in:
JT2M0L3Y
2026-07-03 11:07:20 -07:00
parent 4aadea4611
commit b492d8f62f
6 changed files with 40 additions and 39 deletions
+18 -20
View File
@@ -1,6 +1,10 @@
name: Coverage
run-name: Code Coverage
on:
pull_request:
branches:
- master
push:
branches:
- master
@@ -10,19 +14,19 @@ jobs:
runs-on: ubuntu-latest
environment: coverage
timeout-minutes: 2
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Node Environment lts/jod
- name: Set up Node Environment
uses: actions/setup-node@v4
with:
node-version: lts/jod
cache: "npm"
node-version: current
cache: npm
- name: Install Project Dependencies
run: |
npm install
run: npm install
- name: Create Environment Variables
run: |
@@ -32,19 +36,13 @@ jobs:
echo OLLAMA_PORT = ${{ secrets.OLLAMA_PORT }} >> .env
echo MODEL = ${{ secrets.MODEL }} >> .env
- name: Collect Code Coverage
run: |
LINE_PCT=$(npm run coverage | tail -2 | head -1 | awk '{print $3}')
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
- name: Upload Code Coverage
uses: schneegans/dynamic-badges-action@v1.7.0
- name: Run tests with coverage
run: npm run coverage
- name: Upload Coverage to Codecov
id: codecov
uses: codecov/codecov-action@v5
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ vars.GIST_ID }}
filename: coverage.json
label: Coverage
message: ${{ env.COVERAGE }}
valColorRange: ${{ env.COVERAGE }}
maxColorRange: 100
minColorRange: 0
files: coverage/lcov.info
fail_ci_if_error: true
continue-on-error: true