-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (194 loc) · 7.34 KB
/
test.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
198
199
200
201
202
203
name: 'Test'
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-bump:
name: 'Version Bump'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
fetch-depth: 0 # deep clone the repo
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)
git add --update && git commit --message "Set Version: ${new_version}" || true
- name: 'Push updates'
run: git push origin HEAD:${GITHUB_HEAD_REF}
python-code-quality-checks:
name: 'Code Quality Checks'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Install Python'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v9
- name: 'Build kmxwasm'
run: poetry -C kmxwasm install
- name: 'Run code quality checks'
run: make -C kmxwasm check
- name: 'Run unit tests'
run: make -C kmxwasm test-unit
integration-tests:
name: 'Kmxwasm integration tests'
runs-on: [self-hosted, linux, normal]
needs: [python-code-quality-checks]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: mx-wasm-ci-${{ github.sha }}
- name: 'Build kmxwasm'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make kmxwasm
- name: 'Build semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build
- name: 'Run integration tests'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make -C kmxwasm test-integration
- name: 'Tear down Docker'
if: always()
run: docker stop --time 0 mx-wasm-ci-${GITHUB_SHA}
booster-tests:
name: 'Kmxwasm booster tests'
runs-on: [self-hosted, linux, normal]
needs: [python-code-quality-checks]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: mx-wasm-ci-${{ github.sha }}
- name: 'Build kmxwasm'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make kmxwasm
- name: 'Build semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build
- name: 'Run booster tests'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make -C kmxwasm test-booster
- name: 'Tear down Docker'
if: always()
run: docker stop --time 0 mx-wasm-ci-${GITHUB_SHA}
claim-generation-tests:
name: 'Kasmer claim generation tests'
runs-on: [self-hosted, linux, normal]
needs: [python-code-quality-checks]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: mx-wasm-ci-${{ github.sha }}
- name: 'Build kmxwasm'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make kmxwasm
- name: 'Build semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build-kasmer
- name: 'Generate claims'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} ./generate-claims.sh
- name: 'Tear down Docker'
if: always()
run: docker stop --time 0 mx-wasm-ci-${GITHUB_SHA}
lemma-tests:
name: 'Build and Test lemmas'
runs-on: [self-hosted, linux, normal]
needs: [python-code-quality-checks]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: mx-wasm-ci-${{ github.sha }}
- name: 'Build kmxwasm'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make kmxwasm
- name: 'Build semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build
- name: 'Check lemmas are up to date'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make -C kmxwasm test-lemmas-not-changed
- name: 'Test lemmas'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make -C kmxwasm test-lemmas
- name: 'Prove lemmas'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make -C kmxwasm test-proofs
- name: 'Tear down Docker'
if: always()
run: docker stop --time 0 mx-wasm-ci-${GITHUB_SHA}
smoke-tests:
name: 'Smoke tests'
runs-on: [self-hosted, linux, normal]
needs: [python-code-quality-checks]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: mx-wasm-ci-${{ github.sha }}
- name: 'Build kmxwasm'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make kmxwasm
- name: 'Build semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build
- name: 'Build kasmer semantics'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} make build-kasmer
- name: 'Run smoke tests'
run: docker exec --user user mx-wasm-ci-${GITHUB_SHA} poetry -C kmxwasm run ./package/smoke-test.sh
- name: 'Tear down Docker'
if: always()
run: docker stop --time 0 mx-wasm-ci-${GITHUB_SHA}
nix:
name: 'Nix'
strategy:
fail-fast: false
matrix:
include:
- runner: [self-hosted, linux, normal]
- runner: self-macos-14
needs: [python-code-quality-checks]
runs-on: ${{ matrix.runner }}
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Build Kasmer'
run: GC_DONT_GC=1 nix build .#kmxwasm --extra-experimental-features 'nix-command flakes' --print-build-logs
- name: 'Run smoke tests'
run: GC_DONT_GC=1 nix develop .#kmxwasm-test-shell --extra-experimental-features 'nix-command flakes' --print-build-logs --command './package/smoke-test.sh'
- name: 'Run claim generation tests'
run: GC_DONT_GC=1 nix develop .#kmxwasm-test-shell --extra-experimental-features 'nix-command flakes' --print-build-logs --command './generate-claims.sh'