Skip to content

Commit

Permalink
perf: use foundry official docker to run CI and speed up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenli86 committed Feb 15, 2025
1 parent 053d599 commit 2790606
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
test-suite:
name: Test
runs-on: protocol-x64-16core
container:
image: ghcr.io/foundry-rs/foundry:stable
strategy:
matrix:
suite: [Unit, Integration, Fork]
Expand All @@ -31,12 +33,6 @@ jobs:
with:
submodules: recursive

# Install the Foundry toolchain.
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

# Run Forge's formatting checker to ensure consistent code style.
- name: "Forge Fmt"
run: |
Expand Down Expand Up @@ -67,6 +63,8 @@ jobs:
continuous-fuzzing:
name: Test (Intense)
runs-on: protocol-x64-16core
container:
image: ghcr.io/foundry-rs/foundry:stable
# Only run on push events to dev branch, not on PR events
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
strategy:
Expand All @@ -77,12 +75,6 @@ jobs:
with:
submodules: recursive

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

# Build the project and display contract sizes.
- name: "Forge Build"
run: |
Expand All @@ -104,18 +96,14 @@ jobs:
storage-diff:
name: Test (Storage)
runs-on: protocol-x64-16core
container:
image: ghcr.io/foundry-rs/foundry:stable
steps:
# Check out repository with all submodules for complete codebase access.
- uses: actions/checkout@v4
with:
submodules: recursive

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

# Run storage diff check to detect storage layout incompatibilities.
- name: "Mainnet Storage Diff"
run: |
Expand All @@ -129,6 +117,8 @@ jobs:
run-coverage:
name: Coverage
runs-on: protocol-x64-16core
container:
image: ghcr.io/foundry-rs/foundry:stable
# Only run coverage checks on dev, testnet-holesky, and mainnet branches, or PRs targeting these branches
if: |
github.ref == 'refs/heads/dev' ||
Expand All @@ -145,12 +135,6 @@ jobs:
with:
submodules: recursive

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

# Install LCOV for coverage report generation.
- name: Install LCOV
run: |
Expand Down Expand Up @@ -209,18 +193,14 @@ jobs:
compare-contract-sizes:
name: Size Diff
runs-on: protocol-x64-16core
container:
image: ghcr.io/foundry-rs/foundry:stable
steps:
# Check out repository with all submodules for complete codebase access.
- uses: actions/checkout@v4
with:
submodules: recursive

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Build contracts on PR branch
run: |
forge build --json --sizes | jq '.' > pr_sizes.json
Expand Down

0 comments on commit 2790606

Please sign in to comment.