Skip to content

Commit

Permalink
ci: add codecov github action
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkjrs committed Jan 21, 2025
1 parent 2f22724 commit 06359c6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Coverage

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-and-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Run tests with coverage
run: npm test -- --coverage

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }} # Set in GitHub repository secrets
files: ./coverage/lcov.info # Adjust path if necessary
flags: unittests # Optional flags for tracking different types of tests
name: codecov-coverage-report # Optional, useful for identifying reports
fail_ci_if_error: true # Fails CI if Codecov upload fails

0 comments on commit 06359c6

Please sign in to comment.