forked from filecoin-project/fevm-contract-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (140 loc) · 5.28 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Run tests against Fendermint (remote Docker image)
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch: # Enable manual running
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout Test Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout Fendermint
uses: actions/checkout@v2
with:
repository: 'consensus-shipyard/ipc'
submodules: 'recursive'
path: 'ipc'
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 18.19.0
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Set up Rust cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install cargo-make
run: |
if ! command -v cargo-make &> /dev/null
then
cargo install -f cargo-make
fi
- uses: actions/cache/save@v3
if: always()
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Foundry
run: |
cd contracts
curl -L https://foundry.paradigm.xyz | bash
export PATH="$PATH:/home/runner/.config/.foundry/bin"
foundryup
- name: Create a docker build
id: docker-build
run: |
export PATH="$PATH:/home/runner/.config/.foundry/bin"
cd $GITHUB_WORKSPACE/ipc/fendermint
make docker-build
- name: Run a testnode
id: testnode
run: |
cd $GITHUB_WORKSPACE/ipc/
export BALANCE=10000000000
{ out=$(FM_PULL_SKIP=true cargo make --makefile ./infra/fendermint/Makefile.toml testnode | tee /dev/fd/3); } 3>&1
private_key=$(echo $out | sed -e 's/\(.*\)\([a-f0-9]\{64\}\)/0x\2/' | grep 0x | head -c66)
echo "ROOT_PRIVATE_KEY=$private_key" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: 'Create and fund accounts'
id: accounts
env:
NUM_ACCOUNTS: 5
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
run: |
npx hardhat --network local create-fund-accounts
- name: 'Run tests: web3.js SimpleCoin'
if: always()
env:
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/web3.js/SimpleCoin.js
- name: 'Run tests: web3.js ERC20'
if: always()
timeout-minutes: 2
env:
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/web3.js/ERC20.js
- name: 'Run tests: ethers.js SimpleCoin'
if: always()
timeout-minutes: 2
env:
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/ethers.js/SimpleCoin.js
- name: 'Run tests: ethers.js ERC20'
if: always()
timeout-minutes: 2
env:
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/ethers.js/ERC20.js
- name: 'Run tests: Uniswap -- SKIPPING'
if: always()
timeout-minutes: 200
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT2_PRIVATE_KEY }}
LOCAL_NODE_URL: 'http://127.0.0.1:8545'
run: |
echo skipping ; #cd ./extern/fevm-uniswap-v3-core && yarn install --frozen-lockfile && yarn compile && npx hardhat test test/UniswapV3Pool.spec.ts # && yarn test
- name: 'Run tests: OpenZeppelin -- SKIPPING'
if: always()
env:
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
USER_2_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT2_PRIVATE_KEY }}
USER_3_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT3_PRIVATE_KEY }}
USER_4_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT4_PRIVATE_KEY }}
USER_5_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT5_PRIVATE_KEY }}
run: |
echo skipping ; #cd ./extern/openzeppelin-contracts/ && yarn && mkdir gasreport && npx hardhat --network itest test