This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
Merge pull request #32 from ionicprotocol/test/levered-positions-retro #184
This file contains 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: Pull Request - build and run tests | |
on: | |
push: | |
branches: | |
- main | |
- development | |
pull_request: | |
branches: | |
- main | |
- development | |
env: | |
EXCLUDE_TESTS: "Abstract|BeefyERC4626Test|DotDotERC4626Test|ArrakisERC4626Test|JarvisERC4626Test|CurveERC4626Test|EllipsisERC4626Test|HelioERC4626Test|WombatERC4626Test|AaveV3ERC4626Test|ThenaERC4626Test" | |
FLAKY_TESTS: "AnyLiquidationTest|LiquidityMiningTest" | |
SLOW_TESTS: "MaxBorrowTest|OraclesDecimalsScalingTest|MinBorrowTest|LeveredPositionTest|OraclesDecimalsScalingTest" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install Npm dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
# build-and-test-bsc: | |
# needs: [lint] | |
# env: | |
# MNEMONIC: "${{ secrets.MNEMONIC }}" | |
# BSC_MAINNET_RPC_URL: https://bsc-dataseed.binance.org | |
# BSC_MAINNET_ARCHIVE_RPC_URL: https://rpc.ankr.com/bsc | |
# TEST_RUN_CHAINID: 56 | |
# TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# submodules: recursive | |
# - name: Install Foundry | |
# uses: onbjerg/foundry-toolchain@v1 | |
# with: | |
# version: nightly | |
# - name: Install Forge dependencies | |
# run: forge install | |
# - name: Forge RPC cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: "~/.foundry/cache" | |
# key: rpc-cache-bsc-${{ hashFiles('rpc-cache-keyfile') }} | |
# - name: Run base tests for BSC mainnet | |
# run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
# - name: Run slow tests for BSC mainnet | |
# if: always() | |
# run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
# - name: Run flaky tests for BSC mainnet | |
# if: always() | |
# run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-polygon: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
POLYGON_MAINNET_RPC_URL: https://polygon.llamarpc.com | |
POLYGON_MAINNET_ARCHIVE_RPC_URL: https://rpc.ankr.com/polygon | |
TEST_RUN_CHAINID: 137 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-polygon-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for Polygon mainnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for Polygon mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for Polygon mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-arbitrum: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
ARBITRUM_MAINNET_RPC_URL: https://1rpc.io/arb | |
ARBITRUM_MAINNET_ARCHIVE_RPC_URL: https://arb1.croswap.com/rpc | |
TEST_RUN_CHAINID: 42161 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-arbitrum-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for Arbitrum mainnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for Arbitrum mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for Arbitrum mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-neon: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
NEON_RPC_URL: https://neon-proxy-mainnet.solana.p2p.org | |
NEON_ARCHIVE_RPC_URL: https://neon-proxy-mainnet.solana.p2p.org | |
TEST_RUN_CHAINID: 245022934 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-neon-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for Neon mainnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for Neon mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for Neon mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-chapel: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
BSC_CHAPEL_RPC_URL: https://data-seed-prebsc-1-s3.binance.org:8545 | |
BSC_CHAPEL_ARCHIVE_RPC_URL: https://data-seed-prebsc-1-s3.binance.org:8545 | |
TEST_RUN_CHAINID: 97 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-chapel-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for Chapel testnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for Chapel testnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for Chapel testnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
# build-and-test-ethereum: | |
# needs: [lint] | |
# env: | |
# MNEMONIC: "${{ secrets.MNEMONIC }}" | |
# TEST_RUN_CHAINID: 1 | |
# TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
# ETHEREUM_MAINNET_RPC_URL: https://eth.llamarpc.com | |
# ETHEREUM_MAINNET_ARCHIVE_RPC_URL: https://rpc.ankr.com/eth | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# submodules: recursive | |
# - name: Install Foundry | |
# uses: onbjerg/foundry-toolchain@v1 | |
# with: | |
# version: nightly | |
# - name: Install Forge dependencies | |
# run: forge install | |
# - name: Forge RPC cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: "~/.foundry/cache" | |
# key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }} | |
# - name: Run base tests for Ethereum mainnet | |
# run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
# - name: Run slow tests for Ethereum mainnet | |
# if: always() | |
# run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
# - name: Run flaky tests for Ethereum mainnet | |
# if: always() | |
# run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-linea: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
TEST_RUN_CHAINID: 59144 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
LINEA_RPC_URL: https://rpc.linea.build | |
LINEA_ARCHIVE_RPC_URL: https://rpc.linea.build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for Linea mainnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for Linea mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for Linea mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-zkevm: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
TEST_RUN_CHAINID: 1101 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
ZKEVM_MAINNET_RPC_URL: https://zkevm-rpc.com | |
ZKEVM_MAINNET_ARCHIVE_RPC_URL: https://zkevm-rpc.com | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run base tests for zkevm mainnet | |
run: forge test -vv --no-match-contract '${{ env.EXCLUDE_TESTS }}|${{ env.FLAKY_TESTS }}|${{ env.SLOW_TESTS }}' | |
- name: Run slow tests for zkevm mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.SLOW_TESTS }}' | |
- name: Run flaky tests for zkevm mainnet | |
if: always() | |
run: forge test -vv --match-contract '${{ env.FLAKY_TESTS }}' | |
build-and-test-local: | |
needs: [lint] | |
env: | |
MNEMONIC: "${{ secrets.MNEMONIC }}" | |
TEST_RUN_CHAINID: 0 | |
TEST_RUN_LEVEL: ${{ github.event_name == 'pull_request' && '100' || '90' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Forge dependencies | |
run: forge install | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.foundry/cache" | |
key: rpc-cache-local-${{ hashFiles('rpc-cache-keyfile') }} | |
- name: Run forge tests locally | |
run: forge test -vv --no-match-contract 'Abstract|BeefyERC4626Test|DotDotERC4626Test|ArrakisERC4626Test|JarvisERC4626Test|CurveERC4626Test|EllipsisERC4626Test|HelioERC4626Test|WombatERC4626Test|AaveV3ERC4626Test|ThenaERC4626Test' |