Skip to content

fix: contracts testing worflow #710

fix: contracts testing worflow

fix: contracts testing worflow #710

name: Contracts Testing
on:
workflow_dispatch:
push:
branches:
- master
- dev
pull_request:
branches:
- "*"
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/[email protected]
with:
egress-policy: audit
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
- name: Enable Corepack
run: corepack enable
- name: Set Yarn version to Berry
run: yarn set version 4.2.2
- uses: actions/[email protected]
- name: Cache node modules
uses: actions/[email protected]
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
#- name: Install parent dependencies
# run: |
# echo "current dir: $PWD"
# yarn install
- name: Install contracts dependencies
run: |
yarn workspace @kleros/vea-contracts install
- name: Compile
run: |
yarn hardhat compile
working-directory: contracts
- name: Test with coverage
run: |
yarn hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"./test/**/*.ts\" --show-stack-traces
working-directory: contracts
- name: Upload a build artifact
uses: actions/[email protected]
with:
name: code-coverage-report
path: contracts/coverage