fix 3 #7
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
name: CI | |
'on': | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
FOUNDRY_PROFILE: ci | |
jobs: | |
check: | |
strategy: | |
fail-fast: true | |
name: Foundry project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Show Forge version | |
run: | | |
forge --version | |
- name: Run Forge fmt | |
run: | | |
forge fmt --check | |
id: fmt | |
- name: Run Forge build | |
run: | | |
forge build --sizes | |
id: build | |
- name: Run Forge tests and Deployment | |
run: > | |
export | |
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | |
&& | |
anvil --fork-url https://sepolia.unichain.org/ \ | |
--fork-block-number 6373360 \ | |
--fork-chain-id 1301 \ | |
--chain-id 1301 & | |
sleep 1 | |
for i in $(seq 1 15); do | |
if curl -I http://localhost:8545 > /dev/null 2>&1; then | |
echo "Anvil is ready" | |
break | |
else | |
echo "Waiting for anvil to start, Attempt: $i" | |
sleep 1 | |
if [[ $i -eq 15 ]]; then | |
echo "Anvil Failed to Start" | |
exit 1 | |
fi | |
fi | |
done | |
forge script script/DeployAndTest.s.sol --fork-url http://localhost:8545 --broadcast & | |
forge test --match-path test/Glottis20FactoryTest.t.sol -vvvv --fork-url http://localhost:8545 & | |
wait | |
id: test |