forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add additional ci jobs for forks (foundry-rs#1728)
* ci: add additional ci jobs for forks * test: fix flaky anvil test * ci: setup git config * ci: setup git config * ci: setup git config global * chore: fix flaky snapshot test
- Loading branch information
Showing
8 changed files
with
109 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,26 @@ jobs: | |
unit: | ||
name: unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: cargo test | ||
run: cargo test --locked --workspace --all-features --lib --bins -- --skip fork | ||
|
||
fork-unit: | ||
name: fork unit tests | ||
runs-on: ubuntu-latest | ||
env: | ||
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD | ||
steps: | ||
|
@@ -29,32 +49,38 @@ jobs: | |
uses: actions/cache@v3 | ||
with: | ||
path: "$HOME/.foundry/cache" | ||
key: rpc-cache-${{ hashFiles('cli/tests/it/integration.rs') }} | ||
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }} | ||
|
||
- name: cargo test | ||
run: cargo test --locked --workspace --all-features --lib --bins | ||
run: cargo test --locked --workspace --all-features --lib --bins fork | ||
|
||
doc: | ||
name: doc tests | ||
integration: | ||
name: integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
|
||
# required for forge commands that use git | ||
- name: setup git config | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "<>" | ||
- name: cargo test | ||
run: cargo test --locked --workspace --all-features --doc | ||
run: cargo test --locked --workspace -- --skip fork | ||
|
||
integration: | ||
name: integration tests | ||
fork-integration: | ||
name: fork integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
|
@@ -74,14 +100,37 @@ jobs: | |
uses: actions/cache@v3 | ||
with: | ||
path: "$HOME/.foundry/cache" | ||
key: rpc-cache-${{ hashFiles('cli/tests/it/integration.rs') }} | ||
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }} | ||
|
||
- name: cargo test | ||
run: cargo test --locked --workspace --test '*' | ||
run: cargo test --locked --workspace -- fork | ||
|
||
external-integration: | ||
name: external integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Force use of HTTPS for submodules | ||
run: git config --global url."https://github.com/".insteadOf "[email protected]:" | ||
|
||
- name: cargo test | ||
run: cargo test --locked -p foundry-cli --features external-integration-tests -- --skip fork | ||
|
||
external-fork-integration: | ||
name: external fork integration tests | ||
runs-on: ubuntu-latest | ||
env: | ||
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD | ||
steps: | ||
|
@@ -101,13 +150,32 @@ jobs: | |
uses: actions/cache@v3 | ||
with: | ||
path: "$HOME/.foundry/cache" | ||
key: rpc-cache-${{ hashFiles('cli/tests/it/integration.rs') }} | ||
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }} | ||
|
||
- name: Force use of HTTPS for submodules | ||
run: git config --global url."https://github.com/".insteadOf "[email protected]:" | ||
|
||
- name: cargo test | ||
run: cargo test --locked --workspace --features external-integration-tests --test '*' | ||
run: cargo test --locked -p foundry-cli --features external-integration-tests fork_integration | ||
|
||
doc: | ||
name: doc tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: cargo test | ||
run: cargo test --locked --workspace --all-features --doc | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
Compiling 3 files with 0.8.10 | ||
Compiling 2 files with 0.8.10 | ||
Solc 0.8.10 finished in 424.55ms | ||
Compiler run successful | ||
|
||
Running 1 test for src/ATest.t.sol:ATest | ||
[32m[PASS][0m testExample() (gas: 168) | ||
Test result: [32mok[0m. 1 passed; 0 failed; finished in 4.42ms | ||
|
||
Running 1 test for src/BTest.t.sol:BTest | ||
[32m[PASS][0m testExample() (gas: 168) | ||
Test result: [32mok[0m. 1 passed; 0 failed; finished in 4.42ms |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This file serves as the key for the github actions/cache | ||
|
||
Any change in this file will invalidate the cache in CI that stores RPC data. | ||
|
||
Last updated: 05-26-2022 |