mirror of
https://github.com/vacp2p/foundry-template.git
synced 2025-03-03 08:30:40 +00:00
ci: expose env vars in GitHub workflow
test: add explanatory code comments in fork test
This commit is contained in:
parent
0efda5eabb
commit
49b82cbcd4
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -1,7 +1,11 @@
|
|||||||
name: "CI"
|
name: "CI"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
|
||||||
|
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
|
||||||
FOUNDRY_PROFILE: "ci"
|
FOUNDRY_PROFILE: "ci"
|
||||||
|
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
|
||||||
|
MNEMONIC: ${{ secrets.MNEMONIC }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -33,9 +33,12 @@ contract FooTest is PRBTest, StdCheats {
|
|||||||
/// for this test to run - you can get an API key for free at https://alchemy.com.
|
/// for this test to run - you can get an API key for free at https://alchemy.com.
|
||||||
function testFork_Example() external {
|
function testFork_Example() external {
|
||||||
string memory alchemyApiKey = vm.envOr("ALCHEMY_API_KEY", string(""));
|
string memory alchemyApiKey = vm.envOr("ALCHEMY_API_KEY", string(""));
|
||||||
|
// Silently pass this test if the user didn't define the API key.
|
||||||
if (bytes(alchemyApiKey).length == 0) {
|
if (bytes(alchemyApiKey).length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run the test normally, otherwise.
|
||||||
vm.createSelectFork({urlOrAlias: "ethereum", blockNumber: 16_428_000});
|
vm.createSelectFork({urlOrAlias: "ethereum", blockNumber: 16_428_000});
|
||||||
address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
|
address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
|
||||||
address holder = 0x7713974908Be4BEd47172370115e8b1219F4A5f0;
|
address holder = 0x7713974908Be4BEd47172370115e8b1219F4A5f0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user