Skip to content

Code4rena deploy

Code4rena deploy #853

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
sizes:
strategy:
fail-fast: true
name: Contract sizes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Contract sizes
run: |
forge --version
forge build --sizes --skip CryticTester
id: build
fmt:
strategy:
fail-fast: true
name: Forge Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Format
run: |
forge fmt --check
id: fmt
test:
strategy:
fail-fast: true
name: Forge Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Test
run: |
forge test -vvv
id: test
testFork:
strategy:
fail-fast: true
name: Forge Fork Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Test Fork
run: |
forge test -vvv
id: test
env:
API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }}
FOUNDRY_INVARIANT_RUNS: 0
FOUNDRY_INVARIANT_DEPTH: 0
FOUNDRY_PROFILE: fork
slither:
strategy:
fail-fast: true
name: Slither
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Slither
uses: crytic/slither-action@v0.3.1
id: slither
with:
fail-on: low
solhint:
strategy:
fail-fast: true
name: Solhint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: npm install
- name: Run solhint
run: npm run solhint
invariants:
needs: [sizes, fmt, test, testFork, slither, solhint]
strategy:
fail-fast: true
matrix:
mode: [assertion, property]
name: Echidna
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Crytic-compile
run: |
pip install crytic-compile
- name: Install Slither
run: |
pip install slither-analyzer
- name: Install Echidna
run: |
wget https://github.com/crytic/echidna/releases/download/v2.2.3/echidna-2.2.3-x86_64-linux.tar.gz -O echidna.tar.gz
tar -xvkf echidna.tar.gz
rm echidna.tar.gz
./echidna --version
- name: Echidna ${{ matrix.mode }}
run: |
./script/prepare_crytic.sh
./echidna . --contract CryticTester --config echidna.yaml --test-mode ${{ matrix.mode }} --corpus-dir corpus --test-limit 10000
abi:
strategy:
fail-fast: true
name: ABI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: npm install
- name: ABI
run: |
forge build --build-info
- name: Archive ABI
uses: actions/upload-artifact@v4
with:
name: abi
path: |
out/Size.sol/Size.json
out/IPriceFeed.sol/IPriceFeed.json
out/IPool.sol/IPool.json
out/WETH.sol/WETH.json
out/USDC.sol/USDC.json
out/Errors.sol/Errors.json
out/Events.sol/Events.json
coverage:
strategy:
fail-fast: true
name: Coverage
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: npm install
- name: Setup git config
run: |
git config --local user.email "dev@size.cash"
git config --local user.name "Size"
- name: Coverage
run: |
./script/update_readme_coverage.sh
git add README.md
git commit -m "Update coverage [skip ci]" || true
- name: Push
run: |
git push https://${{ env.token }}@github.com/${{ github.event.repository.full_name }}.git
env:
token: ${{ secrets.SIZE_BOT_PAT }}