|
| 1 | +name: CI |
| 2 | + |
| 3 | +env: |
| 4 | + API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }} |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + |
| 12 | +jobs: |
| 13 | + ci: |
| 14 | + runs-on: |
| 15 | + labels: ubuntu-latest-large |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - job_name: lint |
| 20 | + command: bun run lint |
| 21 | + summary: "## Lint result" |
| 22 | + - job_name: build |
| 23 | + command: forge build |
| 24 | + summary: "## Build result" |
| 25 | + - job_name: coverage |
| 26 | + command: forge coverage --fuzz-runs 256 --report lcov --report-file ./test-forge-cover.txt |
| 27 | + summary: "## Coverage result" |
| 28 | + name: ${{ matrix.job_name }} |
| 29 | + steps: |
| 30 | + - name: Check out the repo |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + submodules: recursive |
| 34 | + |
| 35 | + - name: Install Foundry |
| 36 | + uses: foundry-rs/foundry-toolchain@v1 |
| 37 | + |
| 38 | + - name: Install Bun |
| 39 | + uses: oven-sh/setup-bun@v1 |
| 40 | + |
| 41 | + - name: Install the Node.js dependencies |
| 42 | + run: bun install |
| 43 | + |
| 44 | + - name: Execute Job Command |
| 45 | + run: ${{ matrix.command }} |
| 46 | + |
| 47 | + - name: Add Job Summary |
| 48 | + run: | |
| 49 | + echo ${{ matrix.summary }} >> $GITHUB_STEP_SUMMARY |
| 50 | + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |
| 51 | +
|
| 52 | + - if: ${{ matrix.job_name == 'coverage' }} |
| 53 | + name: Upload coverage reports to Codecov |
| 54 | + uses: codecov/codecov-action@v2 |
| 55 | + with: |
| 56 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 57 | + files: ./test-forge-cover.txt |
| 58 | + |
| 59 | + slither: |
| 60 | + runs-on: |
| 61 | + labels: ubuntu-latest-large |
| 62 | + steps: |
| 63 | + - name: Check out the repo |
| 64 | + uses: actions/checkout@v4 |
| 65 | + with: |
| 66 | + submodules: recursive |
| 67 | + |
| 68 | + - name: Run Slither Analysis |
| 69 | + |
| 70 | + with: |
| 71 | + fail-on: none |
| 72 | + |
| 73 | + - name: Slither Summary |
| 74 | + run: | |
| 75 | + echo "## Slither result" >> $GITHUB_STEP_SUMMARY |
| 76 | + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |
0 commit comments