style: Run forge fmt #107
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| FOUNDRY_PROFILE: ci | |
| jobs: | |
| check: | |
| name: Foundry project | |
| 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 Forge fmt | |
| run: | | |
| forge fmt --check | |
| id: fmt | |
| - name: Run Forge build | |
| run: | | |
| forge build --sizes | |
| id: build | |
| - name: Run Forge tests | |
| run: | | |
| forge test -vvv | |
| id: test | |
| # --------------------------- | |
| # Slither analysis (minimal) | |
| # - produce JSON in reports/json/ | |
| # - do not immediately fail on slither exit; we explicitly fail only if High/High findings are present | |
| # --------------------------- | |
| - name: Prepare slither output directory | |
| run: | | |
| mkdir -p reports/json | |
| - name: Run Slither (Docker) | |
| run: | | |
| # Run Slither inside official container and write JSON to reports/json/slither.json | |
| # If slither returns non-zero, don't kill the workflow here (we'll check results explicitly). | |
| docker run --rm -v "${{ github.workspace }}":/src -w /src crytic/slither slither . --json reports/json/slither.json || true | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Fail on High severity + High confidence findings | |
| run: | | |
| python3 scripts/slither/slither_fail_on_high.py |