Skip to content

Commit

Permalink
chore: github actions workflow to run the foundry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Dec 13, 2024
1 parent 6437726 commit 889cf63
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/contracts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ jobs:
54.185.253.63:443
- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 18.x

- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Cache node modules
uses: actions/cache@v4
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
Expand All @@ -57,28 +59,32 @@ jobs:
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/kleros-v2-contracts install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0
with:
version: nightly

- name: Run Foundry tests
run: forge test -vvv
working-directory: contracts

- name: Compile
run: |
yarn hardhat compile
working-directory: contracts

- name: Test with coverage
- name: Run Hardhat tests 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/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: code-coverage-report
path: contracts/coverage

0 comments on commit 889cf63

Please sign in to comment.