generated from Uniswap/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 14
71 lines (65 loc) · 2.4 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy to Tenderly Virtual TestNet
on: [pull_request]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Create Tenderly Virtual TestNet environment: https://docs.tenderly.co/virtual-testnets
- name: Setup Tenderly Virtual TestNet
uses: Tenderly/[email protected]
with:
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }}
project_name: ${{ vars.TENDERLY_PROJECT_SLUG }}
account_name: ${{ vars.TENDERLY_ACCOUNT_SLUG }}
testnet_name: 'Uniswap VNet CI/CD ${{ github.run_id }}'
mode: 'CD'
# ETH Mainnet config: https://docs.tenderly.co/supported-networks
network_id: 1
chain_id: 1
block_number: 'latest'
# Enable explorer & verification: https://docs.tenderly.co/virtual-testnets/testnet-explorer
public_explorer: true
verification_visibility: 'src'
state_sync: false
# Fund wallet using unlimited faucet: https://docs.tenderly.co/virtual-testnets/unlimited-faucet
- name: Fund Account
env:
TENDERLY_ADMIN_RPC_URL: ${{ env.TENDERLY_ADMIN_RPC_URL }}
ADMIN_WALLET: ${{ vars.ADMIN_WALLET }}
run: |
curl $TENDERLY_ADMIN_RPC_URL \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tenderly_setBalance",
"params": [
"${{ vars.ADMIN_WALLET }}",
"0x3635c9adc5dea00000"
],
"id": "1234"
}'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Foundry Build
run: |
forge --version
forge build --sizes
# Deploy & verify contracts
- name: Deploy Contracts
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
FOUNDRY_ETH_RPC_URL: ${{ env.TENDERLY_PUBLIC_RPC_URL }}
FOUNDRY_VERIFIER_URL: ${{ env.TENDERLY_FOUNDRY_VERIFICATION_URL }}
run: |
forge script script/deploy/Deploy-all.s.sol \
--private-key $PRIVATE_KEY \
--rpc-url $FOUNDRY_ETH_RPC_URL \
--verifier-url $FOUNDRY_VERIFIER_URL \
--slow \
--broadcast \
--verify