Skip to content

new mainnet deployment! #13

new mainnet deployment!

new mainnet deployment! #13

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
env:
FOUNDRY_PROFILE: ci
jobs:
check:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.2
- name: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt
continue-on-error: false
- name: Run Forge build
run: |
forge build --sizes
id: build
- name: Run Forge tests (without fork)
run: |
forge test --no-match-contract "GuardedEthTokenSwapperMainnetTest" -vvv
id: test
- name: Generate gas report
run: |
forge test --gas-report
id: gas-report
continue-on-error: true
fork-tests:
name: Fork Tests (Mainnet)
runs-on: ubuntu-latest
# Run fork tests only on main branch or manual trigger to save CI time
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.2
- name: Run Fork Tests - Oracle Validation
run: |
forge test \
--match-test testSwapMultipleEthPairs \
--fork-url https://ethereum-rpc.publicnode.com \
--fork-block-number 23620206 \
-vv
id: fork-test
continue-on-error: true
env:
# Use public RPC for CI - may be rate limited but sufficient for testing
ETH_RPC_URL: https://ethereum-rpc.publicnode.com
- name: Run Fork Tests - Liquidity Validation
run: |
forge test \
--match-test testLiquidityValidation \
--fork-url https://ethereum-rpc.publicnode.com \
--fork-block-number 23620206 \
-vv
id: liquidity-test
continue-on-error: true
- name: Run Mainnet Integration Tests
run: |
forge test \
--match-contract "GuardedEthTokenSwapperMainnetTest" \
-vv
id: mainnet-tests
continue-on-error: true
- name: Fork Tests Summary
if: always()
run: |
echo "## Fork Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Validated Fork Tests (Block 23620206)" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.oracle-validation.outcome }}" == "success" ]; then
echo "✅ Oracle validation passed" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Oracle validation had issues" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ steps.liquidity-validation.outcome }}" == "success" ]; then
echo "✅ Liquidity validation passed" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Liquidity validation had issues" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Mainnet Integration Tests (Current Block)" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.mainnet-tests.outcome }}" == "success" ]; then
echo "✅ Mainnet integration tests passed" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Mainnet integration tests had issues" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Note:** Fork tests may fail due to public RPC rate limits." >> $GITHUB_STEP_SUMMARY
echo "For reliable fork testing, run locally with: \`./test_fork.sh\`" >> $GITHUB_STEP_SUMMARY