Skip to content

Spell: Set missing hook wards in spell (#795) #4329

Spell: Set missing hook wards in spell (#795)

Spell: Set missing hook wards in spell (#795) #4329

Workflow file for this run

name: "CI"
on:
pull_request:
push:
branches:
- main
env:
FOUNDRY_PROFILE: ci
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
- name: Run tests
run: forge test --deny warnings --nmp "test/integration/{fork,spell}/**/*.sol"
env:
FOUNDRY_PROFILE: ci
fork-tests:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f" # v2.1.7
with:
workload_identity_provider: ${{ secrets.GCP_WIP }}
service_account: ${{ secrets.GCP_SA }}
create_credentials_file: true
cleanup_credentials: true
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a" # v2.1.2
with:
version: ">= 363.0.0"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
- name: Load secrets
run: python3 script/deploy/load_secrets.py
- name: Run fork and spell tests
run: forge test --match-path "test/integration/{fork,spell}/**/*.sol" -vv
env:
FOUNDRY_PROFILE: ci
pre-migration-validation:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
- name: Run pre-migration validation
run: forge test --match-contract PreMigrationValidation --ffi -vv
env:
FOUNDRY_PROFILE: ci
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
- name: Build contracts
run: |
forge --version
forge build --sizes --skip test --deny warnings
- name: Check formatting
run: forge fmt --check
env:
FOUNDRY_PROFILE: ci
import-order:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check import order
run: python3 script/utils/fix_imports.py --check-order
relative-imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check import order
run: python3 script/utils/fix_imports.py --check-relative
roundtrip-relative-absolute-imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check import order
run: python3 script/utils/fix_imports.py --test-roundtrip
unused-imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check unused imports
run: python3 script/utils/fix_imports.py --check-unused
# halmos:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.13
# architecture: x64
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
# - name: Install `setuptools`
# run: pip install setuptools
# - name: Install Halmos
# run: pip install git+https://github.com/a16z/halmos.git@main
# - name: Show the Halmos version
# run: halmos --version
# - name: Run Halmos symbolic tests
# run: halmos --contract TestMessageLibIdentities --function test
anvil-deploy:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f" # v2.1.7
with:
workload_identity_provider: ${{ secrets.GCP_WIP }}
service_account: ${{ secrets.GCP_SA }}
create_credentials_file: true
cleanup_credentials: true
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a" # v2.1.2
with:
version: ">= 363.0.0"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
#Make sure all tools are installed and with proper versions
- name: Setup deployer tools
env:
CI_MODE: true
run: |
script/deploy/setup.sh
- name: Install dependencies (forge)
run: |
forge install -j 0 --shallow --color auto
- name: Deploy Anvil
run: |
python3 script/deploy/deploy.py --network anvil
coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.4
- name: Run coverage
run: forge coverage --report summary --report lcov --nmp "test/integration/{fork,spell}/**/*.sol"
env:
FOUNDRY_PROFILE: ci-coverage
FORGE_SNAPSHOT_CHECK: false
# To ignore coverage for certain directories modify the paths in this step as needed. The
# below default ignores coverage results for the test and script directories. Alternatively,
# to include coverage in all directories, comment out this step. Note that because this
# filtering applies to the lcov file, the summary table generated in the previous step will
# still include all files and directories.
# The `--rc lcov_branch_coverage=1` part keeps branch info in the filtered report, since lcov
# defaults to removing branch info.
- name: Filter directories
run: |
sudo apt update && sudo apt install -y lcov
lcov --remove lcov.info 'test/*' 'script/*' --output-file lcov.info --rc branch_coverage=1
# This step posts a detailed coverage report as a comment and deletes previous comments on
# each push. The below step is used to fail coverage if the specified coverage threshold is
# not met. The below step can post a comment (when it's `github-token` is specified) but it's
# not as useful, and this action cannot fail CI based on a minimum coverage threshold, which
# is why we use both in this way.
- name: Post coverage report
if: github.event_name == 'pull_request' # This action fails when ran outside of a pull request.
uses: romeovs/lcov-reporter-action@v0.3.1
with:
delete-old-comments: true
lcov-file: ./lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR.
- name: Verify minimum coverage
if: github.event_name == 'pull_request'
uses: zgosalvez/github-actions-report-lcov@v2
with:
coverage-files: ./lcov.info
minimum-coverage: 0 # Set coverage threshold.
spelling:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run codespell
uses: codespell-project/actions-codespell@v2
with:
skip: ./docs
ignore_words_list: embrio
check-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Run benchmarks check
run: ./script/utils/benchmarks.sh check
env:
FOUNDRY_PROFILE: ci
claude-md-tree:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check CLAUDE.md directory tree
run: python3 script/utils/check_claude_tree.py
ward-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Check ward coverage
run: python3 script/utils/check_ward_coverage.py