Skip to content

Commit

Permalink
ci: create code coverage files using nyc and codecov (#22)
Browse files Browse the repository at this point in the history
* ci: create code coverage files using nyc and codecov

* ci: delete paths in test.yml
  • Loading branch information
lumirlumir authored Aug 17, 2024
1 parent c636eb8 commit 1bb6210
Show file tree
Hide file tree
Showing 5 changed files with 1,558 additions and 59 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: codecov

on:
push:
branches: [main]
paths: ['src/**', 'tests/**']

jobs:
codecov:
runs-on: ubuntu-latest

steps:
- name: Set up checkout
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Set up cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Set up node_modules
run: npm ci

- name: Coverage
run: npm run coverage

- name: Upload results to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: test
on:
push:
branches: [main]
paths: ['src/**', 'tests/**']

pull_request:
branches: [main]
paths: ['src/**', 'tests/**']

jobs:
test:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@

# production
/build

# tests
/.nyc_output
/coverage
Loading

0 comments on commit 1bb6210

Please sign in to comment.