forked from yearn/tokenized-strategy-foundry-mix
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (72 loc) · 2.22 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
name: CI
on: [push]
jobs:
foundry-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install forge-std
run: |
forge install foundry-rs/forge-std --no-commit
forge remappings > remappings.txt
- name: Run non-Kontrol tests
run: |
forge test --no-match-path "src/test/kontrol/*" -vvv
- name: Run snapshot without Kontrol tests
run: forge snapshot --no-match-path "src/test/kontrol/*"
kontrol-verification:
runs-on: ubuntu-latest
needs: foundry-test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Kontrol
run: |
python3 -m pip install --upgrade pip
pip install kontrol
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Build Contracts
run: |
forge build --build-info --force
ls -la out/
- name: Run Kontrol Verification
run: |
# Create results directory
mkdir -p verification-results
# Run verification for each specification
for spec in src/test/kontrol/*.k; do
if [ -f "$spec" ]; then
echo "Verifying $(basename "$spec")..."
kontrol prove "$spec" \
--contract-dir ./src/contracts \
--output-dir ./verification-results \
--verbose || {
echo "Verification failed for $spec"
exit 1
}
fi
done
echo "Verification completed successfully!"
- name: Upload Verification Results
if: always()
uses: actions/upload-artifact@v3
with:
name: kontrol-verification-results
path: verification-results/
retention-days: 5