Dev #1192
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: Contract coverage | |
on: | |
push: | |
branches: [main, dev] | |
pull_request: | |
branches: [main, dev] | |
jobs: | |
coverage: | |
name: Contract coverage | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Cache contracts | |
uses: actions/cache@v3 | |
with: | |
path: | | |
packages/*/cache | |
packages/*/artifacts | |
~/.cache/hardhat-nodejs/ | |
key: ${{ runner.os }}-contracts-${{ hashFiles('packages/*/contracts/**/*.sol') }} | |
- name: Run coverage | |
if: steps.cache-contracts.outputs.cache-hit != 'true' | |
run: yarn coverage | |
- name: Upload report | |
if: steps.cache-contracts.outputs.cache-hit != 'true' | |
run: bash <(curl -s https://codecov.io/bash) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |