chore: add coverage #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Install yarn | |
run: npm install -g yarn | |
- id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
yarn- | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Compile contracts | |
run: yarn compile | |
- name: Run unit tests | |
run: yarn test | |
- name: Run tests coverage | |
run: yarn coverage | |
- name: Update Coverage Badge | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
uses: we-cli/coverage-badge-action@main |