Skip to content

👷‍♂️ Add venom-Based CI Tests #4

👷‍♂️ Add venom-Based CI Tests

👷‍♂️ Add venom-Based CI Tests #4

name: 🧪 Venom-based smart contract tests
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
node_version:
- 20
echidna:
- "--config test/echidna.yaml"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}
- name: Activate `venom` backend
run: python scripts/insert_venom_pragma.py
- name: Install Vyper
run: pip install vyper
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
run_install: false
- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Restore pnpm cache
uses: actions/cache@v4
id: pnpm-cache
with:
path: ${{ steps.pnpm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install pnpm project with a clean slate
run: pnpm install --prefer-offline --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Show the Foundry CI config
run: forge config
env:
FOUNDRY_PROFILE: venom
- name: Foundry tests
run: forge test
env:
FOUNDRY_PROFILE: venom
- name: Show the Foundry default config
run: forge config
env:
FOUNDRY_PROFILE: default-venom
- name: Run snapshot
run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY
env:
FOUNDRY_PROFILE: default-venom
- name: Install Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install Echidna
run: brew install echidna
- name: Show the Echidna version
run: echidna --version
- name: Show the Foundry Echidna config
run: forge config
env:
FOUNDRY_PROFILE: venom-echidna
- name: Compile the Echidna test contracts
run: forge build --build-info
env:
FOUNDRY_PROFILE: venom-echidna
- name: Run Echidna ERC-20 property tests
run: echidna test/tokens/echidna/ERC20Properties.sol --contract CryticERC20ExternalHarness ${{ matrix.echidna }}
env:
FOUNDRY_PROFILE: venom-echidna
- name: Run Echidna ERC-721 property tests
run: echidna test/tokens/echidna/ERC721Properties.sol --contract CryticERC721ExternalHarness ${{ matrix.echidna }}
env:
FOUNDRY_PROFILE: venom-echidna