Feat: generate parameters for checkSignatures
by referencing OperatorStateRetriever
on-chain
#370
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Foundry | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- mainnet | |
- testnet-holesky | |
- dev | |
pull_request: | |
env: | |
FOUNDRY_PROFILE: ci | |
RPC_MAINNET: ${{ secrets.RPC_MAINNET }} | |
RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }} | |
HOLESKY_RPC_URL: ${{ secrets.HOLESKY_RPC_URL }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID }} | |
jobs: | |
# ----------------------------------------------------------------------- | |
# Forge Test | |
# ----------------------------------------------------------------------- | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
# Check out repository with all submodules for complete codebase access. | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Install the Foundry toolchain. | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: stable | |
# Run Forge's formatting checker to ensure consistent code style. | |
- name: Forge Fmt | |
run: | | |
forge fmt --check | |
id: fmt | |
# Build the project and display contract sizes. | |
- name: Forge Build | |
run: | | |
forge --version | |
forge build --sizes | |
id: build | |
# Run local tests (unit and integration). | |
- name: Forge Test (Local) | |
run: forge test -vvv | |
# Run integration tests using a mainnet fork. | |
- name: Forge Test Integration (Fork) | |
run: FOUNDRY_PROFILE=forktest forge test --match-contract Integration -vvv | |
# ----------------------------------------------------------------------- | |
# Forge Coverage | |
# ----------------------------------------------------------------------- | |
run-coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
# Check out repository with all submodules for complete codebase access. | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Install the Foundry toolchain. | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: stable | |
# Install LCOV for coverage report generation. | |
- name: Install LCOV | |
run: | | |
sudo apt-get install lcov | |
id: lcov | |
# Build the project and display contract sizes. | |
- name: Forge Build | |
run: | | |
forge --version | |
forge build --sizes | |
id: build | |
# Run Forge coverage with LCOV report format, excluding test and script files | |
- name: Forge Coverage | |
run: | | |
FOUNDRY_DENY_WARNINGS=false FOUNDRY_PROFILE=ci forge coverage --report lcov --report summary --no-match-coverage "script|test" | |
genhtml -q -o report ./lcov.info | |
# Upload coverage report as artifact before potential failure | |
- name: Upload Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: report/* | |
# Check coverage threshold after uploading report | |
- name: Check Coverage Threshold for >=90% | |
run: | | |
LINES_PCT=$(lcov --summary lcov.info | grep "lines" | cut -d ':' -f 2 | cut -d '%' -f 1 | tr -d '[:space:]') | |
FUNCTIONS_PCT=$(lcov --summary lcov.info | grep "functions" | cut -d ':' -f 2 | cut -d '%' -f 1 | tr -d '[:space:]') | |
FAILED=0 | |
if (( $(echo "$LINES_PCT < 90" | bc -l) )); then | |
echo -e "\033[1;31m❌ Lines coverage ($LINES_PCT%) is below minimum threshold of 90%\033[0m" | |
FAILED=1 | |
else | |
echo -e "\033[1;32m✅ Lines coverage ($LINES_PCT%) meets minimum threshold of 90%\033[0m" | |
fi | |
if (( $(echo "$FUNCTIONS_PCT < 90" | bc -l) )); then | |
echo -e "\033[1;31m❌ Functions coverage ($FUNCTIONS_PCT%) is below minimum threshold of 90%\033[0m" | |
FAILED=1 | |
else | |
echo -e "\033[1;32m✅ Functions coverage ($FUNCTIONS_PCT%) meets minimum threshold of 90%\033[0m" | |
fi | |
if [ $FAILED -eq 1 ]; then | |
exit 1 | |
fi |