Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ jobs:
with:
submodules: recursive

# Restore Forge cache
- name: Cache Forge Build
uses: actions/cache@v3
with:
path: |
cache/
out/
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use the commit hash as the key? Since the above defined files may not necessarily change.

Copy link
Contributor Author

@bowenli86 bowenli86 Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't hv strong opinion, any special benefits of using commit hash?

benefits of current way it's more cohesive within iterations of a given PR, which may hv multiple rounds of CI and build can be totally skipped

restore-keys: |
${{ runner.os }}-forge-

# Install the Foundry toolchain.
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down Expand Up @@ -93,6 +104,17 @@ jobs:
with:
submodules: recursive

# Restore Forge cache
- name: Cache Forge Build
uses: actions/cache@v3
with:
path: |
cache/
out/
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol') }}
restore-keys: |
${{ runner.os }}-forge-

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
Expand Down Expand Up @@ -126,6 +148,17 @@ jobs:
with:
submodules: recursive

# Restore Forge cache
- name: Cache Forge Build
uses: actions/cache@v3
with:
path: |
cache/
out/
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol') }}
restore-keys: |
${{ runner.os }}-forge-

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
Expand Down Expand Up @@ -160,20 +193,20 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
# Cache Foundry dependencies
- name: Cache Foundry dependencies

# Restore Foundry and Forge cache
- name: Cache Foundry Dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
~/.foundry
out/
cache/
key: ${{ runner.os }}-foundry-${{ hashFiles('**/foundry.toml', '**/Cargo.lock') }}
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol', '**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-foundry-

# Install the Foundry toolchain.
- name: "Install Foundry"
uses: foundry-rs/foundry-toolchain@v1
Expand Down
Loading