[Ethena ARM] - Invariant Testing #898
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: ARM | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| push: | |
| branches: | |
| - 'main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # increasing available memory for node reduces issues with ganache crashing | |
| # https://nodejs.org/api/cli.html#cli_max_old_space_size_size_in_megabytes | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| jobs: | |
| #################################################### | |
| ### LINTER | |
| #################################################### | |
| lint: | |
| name: Contracts Linter | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Show Forge version | |
| run: forge --version | |
| - name: Run Linter | |
| run: forge fmt --check | |
| #################################################### | |
| ### BUILD | |
| #################################################### | |
| build: | |
| name: Contracts Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Show Forge version | |
| run: forge --version | |
| - name: Install Dependencies | |
| run: forge soldeer install && yarn install | |
| - name: Compile contracts with Forge | |
| run: forge build --sizes | |
| - name: Compile contracts with Hardhat | |
| run: npx hardhat compile | |
| #################################################### | |
| ### TESTS | |
| #################################################### | |
| foundry-unit-tests: | |
| name: Foundry Unit-Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Install Dependencies | |
| run: forge soldeer install && yarn install | |
| - name: Run non-invariant tests | |
| run: forge test --summary --fail-fast --show-progress --mp 'test/unit/**' | |
| foundry-fork-tests: | |
| name: Foundry Fork-Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| PROVIDER_URL: ${{ secrets.PROVIDER_URL }} | |
| FLY_API_KEY: ${{ secrets.FLY_API_KEY }} | |
| SONIC_URL: ${{ secrets.SONIC_URL }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Install Dependencies | |
| run: forge soldeer install && yarn install | |
| - name: Run non-invariant tests | |
| run: forge test --summary --fail-fast --show-progress --mp 'test/fork/**' | |
| foundry-smoke-tests: | |
| name: Foundry Smoke Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| PROVIDER_URL: ${{ secrets.PROVIDER_URL }} | |
| FLY_API_KEY: ${{ secrets.FLY_API_KEY }} | |
| SONIC_URL: ${{ secrets.SONIC_URL }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Install Dependencies | |
| run: forge soldeer install && yarn install | |
| - name: Run non-invariant tests | |
| run: forge test --summary --fail-fast --show-progress --mp 'test/smoke/**' | |
| foundry-tests-invariants: | |
| name: Foundry Invariants Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Install Dependencies | |
| run: forge soldeer install | |
| - name: Run invariant tests (OethARM) | |
| run: | | |
| FOUNDRY_INVARIANT_FAIL_ON_REVERT=false \ | |
| FOUNDRY_MATCH_CONTRACT=FuzzerFoundry_OethARM \ | |
| forge test --summary --fail-fast --show-progress | |
| - name: Run invariant tests (OriginARM) | |
| run: | | |
| FOUNDRY_INVARIANT_FAIL_ON_REVERT=true \ | |
| FOUNDRY_MATCH_CONTRACT=FuzzerFoundry_OriginARM \ | |
| forge test --summary --fail-fast --show-progress |