Skip to content

ci: run Echidna on PRs #1

ci: run Echidna on PRs

ci: run Echidna on PRs #1

Workflow file for this run

name: Echidna
on:
pull_request:
schedule:
# Nightly deep campaign (03:00 UTC). Scheduled workflows only run from the default branch.
- cron: '0 3 * * *'
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: echidna-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NODEJS_VERSION: '20'
ECHIDNA_IMAGE: ghcr.io/crytic/echidna/echidna:v2.3.1
jobs:
echidna-fast:
name: Echidna (fast) / ${{ matrix.contract }}
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
contract:
- EchidnaStakeRegistryHarness
- EchidnaPriceOracleHarness
- EchidnaPostageStampHarness
- EchidnaRedistributionHarness
- EchidnaRedistributionClaimHarness
- EchidnaSystemHarness
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js and Yarn
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODEJS_VERSION }}
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Echidna (fast)
env:
ECHIDNA_CONFIG: echidna/echidna.ci.fast.yaml
ECHIDNA_CONTRACT: ${{ matrix.contract }}
ECHIDNA_TIMEOUT: '900'
run: yarn echidna
- name: Upload reproducers and logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: echidna-fast-${{ matrix.contract }}
path: |
echidna/logs/
echidna/corpus/by-contract/
crytic-export/
if-no-files-found: warn
retention-days: 14
echidna-nightly:
name: Echidna (nightly) / ${{ matrix.contract }}
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
contract:
- EchidnaStakeRegistryHarness
- EchidnaPriceOracleHarness
- EchidnaPostageStampHarness
- EchidnaRedistributionHarness
- EchidnaRedistributionClaimHarness
- EchidnaSystemHarness
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js and Yarn
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODEJS_VERSION }}
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Echidna (nightly, 3 seeds)
env:
ECHIDNA_CONFIG: echidna/echidna.ci.nightly.yaml
ECHIDNA_CONTRACT: ${{ matrix.contract }}
# Per-seed cap so 3 seeds plus compile fit inside the 180-minute job timeout.
ECHIDNA_TIMEOUT: '3000'
run: |
status=0
for seed in 1 2 3; do
echo "::group::Echidna seed ${seed}"
ECHIDNA_SEED="${seed}" ECHIDNA_LOG_DIR="echidna/logs/seed-${seed}" yarn echidna || status=1
echo "::endgroup::"
done
exit "${status}"
- name: Upload reproducers and logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: echidna-nightly-${{ matrix.contract }}
path: |
echidna/logs/
echidna/corpus/by-contract/
crytic-export/
if-no-files-found: warn
retention-days: 30