-
Notifications
You must be signed in to change notification settings - Fork 144
197 lines (189 loc) · 7.2 KB
/
test-pr.yml
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: 'Test PR'
on:
pull_request:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-bump:
name: 'Version Bump'
runs-on: [self-hosted, linux, flyweight-ephemeral]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Configure GitHub user'
run: |
git config user.name devops
git config user.email [email protected]
- name: 'Update version'
run: |
og_version=$(git show origin/${GITHUB_BASE_REF}:package/version)
./package/version.sh bump ${og_version}
./package/version.sh sub
new_version=$(cat package/version)
sed --in-place "s/^VERSION: Final = '.*'$/VERSION: Final = '${new_version}'/" kevm-pyk/src/kevm_pyk/__init__.py
git add --update && git commit --message "Set Version: ${new_version}" || true
- name: 'Push updates'
run: git push origin HEAD:${GITHUB_HEAD_REF}
kevm-pyk-code-quality-checks:
name: 'Code Quality Checks'
runs-on: [self-hosted, linux, flyweight-ephemeral]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Run code quality checks'
run: make -C kevm-pyk check
- name: 'Run pyupgrade'
run: make -C kevm-pyk pyupgrade
kevm-pyk-unit-tests:
needs: kevm-pyk-code-quality-checks
name: 'Unit Tests'
runs-on: [self-hosted, linux, normal-ephemeral]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Run unit tests'
run: |
make -C kevm-pyk cov-unit
kevm-pyk-profile:
needs: kevm-pyk-code-quality-checks
name: 'Profiling'
runs-on: [self-hosted, linux, normal-ephemeral]
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Run profiling'
run: |
make -C kevm-pyk profile
test-concrete-execution:
name: 'Build and Test KEVM concrete execution'
needs: kevm-pyk-code-quality-checks
runs-on: [self-hosted, linux, normal]
timeout-minutes: 45
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: kevm-ci-concrete-${{ github.sha }}
- name: 'Build kevm-pyk'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make poetry'
- name: 'Build targets'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'CXX=clang++-14 poetry -C kevm-pyk run kdist --verbose build -j`nproc` evm-semantics.haskell evm-semantics.kllvm evm-semantics.kllvm-runtime'
- name: 'Test integration'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-integration'
- name: 'Test conformance'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-conformance'
- name: 'Test llvm krun'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-interactive'
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 kevm-ci-concrete-${{ github.sha }}
test-prove:
name: 'Build and Test KEVM proofs'
needs: kevm-pyk-code-quality-checks
runs-on: [self-hosted, linux, fast]
strategy:
fail-fast: false
matrix:
include:
- test-suite: 'test-prove-kprove'
test-args:
timeout: 45
- test-suite: 'test-prove-pyk'
test-args:
timeout: 180
- test-suite: 'test-prove-pyk'
test-args: '--use-booster'
timeout: 150
timeout-minutes: ${{ matrix.timeout }}
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: kevm-ci-haskell-${{ matrix.test-suite }}-${{ github.sha }}
- name: 'Build kevm-pyk'
run: docker exec -u github-user kevm-ci-haskell-${{ matrix.test-suite }}-${{ github.sha }} /bin/bash -c 'make poetry'
- name: 'Build distribution'
run: docker exec -u github-user kevm-ci-haskell-${{ matrix.test-suite }}-${{ github.sha }} /bin/bash -c 'CXX=clang++-14 poetry -C kevm-pyk run kdist --verbose build -j`nproc` evm-semantics.plugin evm-semantics.haskell'
- name: 'Prove Haskell'
run: docker exec -u github-user kevm-ci-haskell-${{ matrix.test-suite }}-${{ github.sha }} /bin/bash -c "make ${{ matrix.test-suite }} PYTEST_ARGS='-vv ${{ matrix.test-args }}' PYTEST_PARALLEL=4"
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 kevm-ci-haskell-${{ matrix.test-suite }}-${{ github.sha }}
nix:
name: 'Nix'
strategy:
fail-fast: false
matrix:
include:
- runner: normal
- runner: macos-13
- runner: ARM64
needs: kevm-pyk-code-quality-checks
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
# Check out pull request HEAD instead of merge commit.
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Install Nix'
if: ${{ matrix.runner == 'macos-13' }}
uses: cachix/install-nix-action@v25
with:
install_url: https://releases.nixos.org/nix/nix-2.19.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = http://cache.nixos.org https://cache.iog.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
- name: 'Install Cachix'
if: ${{ matrix.runner == 'macos-13' }}
uses: cachix/cachix-action@v14
with:
name: k-framework
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
- name: 'Build KEVM'
run: GC_DONT_GC=1 nix build --extra-experimental-features 'nix-command flakes' --print-build-logs
- name: 'Test KEVM'
run: GC_DONT_GC=1 nix build --extra-experimental-features 'nix-command flakes' --print-build-logs .#kevm-test