Skip to content

Commit

Permalink
Add cicd codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinBirkhoff committed Jun 18, 2023
1 parent 436be47 commit 1760538
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/install-action@v2
with:
version: latest

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: pnpm run install, build
run: |
pnpm run init
env:
CI: true
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test CI

on: [push, pull_request]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/install-action@v2
with:
version: latest
- name: Setup Node.js "16.x"
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install dependencies
run: pnpm install
- name: Run Tests
run: pnpm test
- name: Uploading reports
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
verbose: true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"private": true,
"description": "A high quality and reliable React Hooks library.",
"scripts": {
"init": "pnpm install && pnpm run build",
"clean-dist": "rimraf 'packages/*/{lib,es,node_modules,dist}'",
"clean": "pnpm run clean-dist && rimraf node_modules",
"build": "pnpm -r --filter=./packages/* run build",
"test": "jest",
"test": "jest --coverage",
"test:strict": "cross-env REACT_MODE=strict jest",
"coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls"
},
Expand Down

0 comments on commit 1760538

Please sign in to comment.