-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (136 loc) · 4.27 KB
/
Copy pathci.yml
File metadata and controls
165 lines (136 loc) · 4.27 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
RETENTION_DAYS: 14
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.7.0
- name: Show Forge version
run: forge --version
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Cache python packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-3.13-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-3.13-pip-
- name: Install python dependencies
run: pip3 install -r requirements.txt
- name: Clean build artifacts
run: make clean
- name: Check code format
run: make format-check
- name: Run code linting
run: make lint
# - name: Check gas snapshot
# run: make snapshot-check
- name: Build contracts
run: make build
- name: Run tests
run: make test-ci
- name: Run slither analysis
run: make slither
- name: Start anvil
run: |
nohup anvil --port 8545 --silent &
for i in {1..15}; do
if nc -z 127.0.0.1 8545; then
echo "Anvil instance is up"
break
fi
sleep 1
done
- name: Deploy contracts to anvil
env:
SLASHING_MANAGER: "0x0000000000000000000000000000000000000002"
STAKE_MANAGER: "0x0000000000000000000000000000000000000003"
REWARDS_MANAGER: "0x0000000000000000000000000000000000000004"
ORACLE_PRICE_FEED: "0x0000000000000000000000000000000000000005"
run: make deploy-anvil
- name: Generate coverage report
run: make cover > coverage-report.txt
- name: Generate gas report
run: make gas > gas-report.txt
- name: Generate abis
run: |
mkdir -p abis
for contract in CoverPoolFactory CoverPool ICoverPoolFactory ICoverPool; do
find out -name "$contract.json" | while read file; do
dir_name=$(dirname "$file" | sed 's|^out/||')
mkdir -p "abis/$dir_name"
jq '.abi' "$file" > "abis/$dir_name/${contract}.json"
done
done
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage-report.txt
retention-days: ${{ env.RETENTION_DAYS }}
- name: Upload gas report
uses: actions/upload-artifact@v4
with:
name: gas-report
path: gas-report.txt
retention-days: ${{ env.RETENTION_DAYS }}
- name: Upload abis
uses: actions/upload-artifact@v4
with:
name: abis
path: abis/
retention-days: ${{ env.RETENTION_DAYS }}
fork-test-v2:
name: Fork Test (Covered Vault V2)
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.7.0
- name: Run fork tests
env:
ETHEREUM_RPC_URL: ${{ secrets.ETHEREUM_RPC_URL }}
run: make test-fork-v2
fork-test-v1:
name: Fork Test (Covered Vault V1)
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.7.0
- name: Run fork tests
env:
ETHEREUM_RPC_URL: ${{ secrets.ETHEREUM_RPC_URL }}
run: make test-fork-v1