forked from yearn/tokenized-strategy-foundry-mix
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (74 loc) · 2.89 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
name: CI
on: [push]
jobs:
foundry-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
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/*"
formal-verification:
runs-on: ubuntu-latest
needs: foundry-test
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
submodules: recursive
# Download and Extract K Framework
- name: Download K Framework
env:
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}
run: |
echo "Downloading K Framework..."
curl -H "Authorization: token $REPOSITORY_TOKEN" -L -o kframework.tar.gz https://github.com/runtimeverification/k/releases/download/v7.1.170/kframework-7.1.170-src.tar.gz
echo "Validating tarball..."
file kframework.tar.gz || { echo "Download failed"; exit 1; }
echo "Extracting K Framework..."
mkdir -p kframework
tar -xvzf kframework.tar.gz -C kframework --strip-components=1 || { echo "Extraction failed"; exit 1; }
ls -l kframework || { echo "Extraction directory not found"; exit 1; }
echo "Setting up K Framework..."
export PATH=$PATH:$(pwd)/kframework/bin
# Download and Build KEVM
- name: Install KEVM
env:
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}
run: |
echo "Downloading KEVM..."
curl -H "Authorization: token $REPOSITORY_TOKEN" -L -o evm.tar.gz https://github.com/runtimeverification/evm-semantics/archive/refs/tags/v1.0.753.tar.gz
echo "Extracting KEVM..."
mkdir -p evm
tar -xvzf evm.tar.gz -C evm --strip-components=1 || { echo "Extraction failed"; exit 1; }
ls -l evm || { echo "EVM directory not found"; exit 1; }
echo "Building KEVM..."
cd evm
export PATH=$PATH:$(pwd)/bin
echo "Listing KEVM directory contents..."
if [ -f Makefile ]; then
make help || make -pRrq : 2>/dev/null | grep -E '^[a-zA-Z_-]+:'
else
echo "No Makefile found in the evm directory."
exit 1
fi
make deps
make build
# Run the Formal Verification Job
- name: Formal Verification with KEVM
run: |
echo "Running formal verification..."
cd evm
krun verification.k || { echo "Formal verification failed"; exit 1; }