Merge pull request #1037 from liquity/main #339
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: Test contracts | |
env: | |
CI: true | |
FORCE_COLOR: true | |
on: | |
push: | |
paths: | |
- "packages/contracts/**" | |
pull_request: | |
paths: | |
- "packages/contracts/**" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
env: | |
# Workaround for https://github.com/actions/setup-node/issues/317 | |
FORCE_COLOR: 0 | |
- run: yarn install --immutable | |
- name: Test contracts | |
run: yarn test-contracts | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
coverage: | |
runs-on: ubuntu-latest | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'coverage') }} | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
env: | |
# Workaround for https://github.com/actions/setup-node/issues/317 | |
FORCE_COLOR: 0 | |
- run: yarn install --immutable | |
- name: Test contract coverage | |
run: yarn coverage | |
continue-on-error: true | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/contracts/coverage/lcov.info |