Skip to content

ci(library-solidity): updates #1

ci(library-solidity): updates

ci(library-solidity): updates #1

name: Fhevm Host Contracts Hardhat/Forge Tests
on:
pull_request:
jobs:
check-changes:
permissions:
actions: 'read'
contents: 'read'
pull-requests: 'read'
runs-on: ubuntu-latest
outputs:
changes-host-contracts: ${{ steps.filter.outputs.host-contracts }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
host-contracts:
- .github/workflows/host-contracts-npm-tests.yml
- host-contracts/**
build:
needs: check-changes
if: ${{ needs.check-changes.outputs.changes-host-contracts == 'true' }}
runs-on: large_ubuntu_32
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
with:
version: stable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
- run: cp ./host-contracts/.env.example ./host-contracts/.env
- run: npm --prefix ./host-contracts ci --include=optional
- name: "Run JS/TS tests"
run: npm --prefix ./host-contracts run test:mock
- name: "Run forge tests"
run: "cd host-contracts && forge install foundry-rs/forge-std && forge test"