-
Notifications
You must be signed in to change notification settings - Fork 52
307 lines (298 loc) · 10.4 KB
/
Copy pathci.yml
File metadata and controls
307 lines (298 loc) · 10.4 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: Build
on:
pull_request:
merge_group:
push:
branches: [main]
env:
SOLUTION: Tools/BoogieToStrata/BoogieToStrata.sln
jobs:
get-branch-name:
runs-on: ubuntu-latest
steps:
- name: Get branch name
shell: bash
# The workflow is triggered by pull_request so we use `GITHUB_BASE_REF`
run: echo "branch_name=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT
id: get_branch_name
outputs:
branch_name: ${{ steps.get_branch_name.outputs.branch_name }}
build_and_test_lean:
name: Build and test Lean
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install cvc5
uses: ./.github/actions/install-cvc5
- name: Install z3
uses: ./.github/actions/install-z3
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Restore lake cache
# Only use the caches on PRs because there is a risk of stale results:
# https://github.com/strata-org/Strata/issues/952
if: github.event_name == 'pull_request'
uses: ./.github/actions/restore-lake-cache
with:
path: |
.lake
StrataCLI/.lake
StrataPython/.lake
- name: Download ion-java jar for Java codegen test
run: wget -q -O StrataTestExtra/Languages/Java/testdata/ion-java-1.11.11.jar https://github.com/amazon-ion/ion-java/releases/download/v1.11.11/ion-java-1.11.11.jar
- name: Build StrataDDM
uses: leanprover/lean-action@v1
with:
lake-package-directory: StrataDDM
build-args: StrataDDM StrataDDMTest
use-github-cache: false
- name: Build and test Strata
uses: leanprover/lean-action@v1
with:
use-github-cache: false
test: false
- name: Run tests
run: lake test
- name: Verify generated editor syntax files are up to date
run: |
lake env lean --run editors/GenSyntax.lean all
git diff --exit-code editors/vscode/syntaxes/ editors/emacs/
- name: Build StrataPython
uses: leanprover/lean-action@v1
with:
lake-package-directory: StrataPython
build-args: StrataPython StrataPythonTest
use-github-cache: false
test: false
- name: Build StrataCLI
uses: leanprover/lean-action@v1
with:
lake-package-directory: StrataCLI
use-github-cache: false
- name: Save lake cache
uses: ./.github/actions/save-lake-cache
with:
path: |
.lake
StrataCLI/.lake
StrataPython/.lake
- name: Verify Java testdata is up to date
run: |
StrataTestExtra/Languages/Java/regenerate-testdata.sh
git diff --exit-code StrataTestExtra/Languages/Java/testdata/
- name: Build and run strata verify
run: lake exe strata verify ../Examples/SimpleProc.core.st
working-directory: StrataCLI
- name: Build StrataBoole
run: lake build StrataBoole StrataBooleTest
working-directory: StrataBoole
- name: Build BoogieToStrata
run: dotnet build -warnaserror ${SOLUTION}
- name: Test BoogieToStrata
run: dotnet test ${SOLUTION}
- name: Test Strata Command line
run: .github/scripts/testStrataCommand.sh
- name: Validate examples against expected output
working-directory: Examples
shell: bash
run: ./run_examples.sh
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./StrataPython/Tools/strata-python
- name: Run pyInterpret golden-file tests
working-directory: StrataPython/StrataPythonTest
shell: bash
run: ./run_py_interpret.sh
- name: Run pyAnalyze SARIF tests
working-directory: StrataPython/StrataPythonTest
shell: bash
run: python run_py_analyze_sarif.py
- name: Run pyAnalyze golden-file tests
working-directory: StrataPython/StrataPythonTest
shell: bash
run: ./run_py_analyze.sh
- name: Run regex differential tests
working-directory: StrataPython/StrataPythonTest/Regex
run: python diff_test.py
check_pending_python:
needs: build_and_test_lean
name: Check pending Python tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./StrataPython/Tools/strata-python
- name: Restore Lean build cache
# The cache is safe to use here because we just saved it for this exact SHA
# in the build_and_test_lean job
# https://github.com/strata-org/Strata/issues/952
uses: ./.github/actions/restore-lake-cache
with:
path: |
.lake
StrataCLI/.lake
StrataPython/.lake
fail-on-cache-miss: "true"
use-restore-keys: "false"
- name: Install Lean
uses: leanprover/lean-action@v1
with:
auto-config: false
build: false
- name: Install cvc5
uses: ./.github/actions/install-cvc5
with:
install-to: system
- name: Check pending tests for newly passing
working-directory: StrataPython/StrataPythonTest
shell: bash
run: ./run_py_analyze.sh --check-pending
lint_checks:
name: Run lint checks
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check copyright headers
uses: ./.github/actions/check-copyright-headers
- name: Check for trailing whitespace
uses: ./.github/actions/lint-whitespace
- name: Check for import Lean
uses: ./.github/actions/check-lean-import
- name: Check Lean version consistency
run: .github/scripts/check_lean_consistency.sh
- name: Check for new panic! usage
uses: ./.github/actions/check-no-panic
with:
base-ref: "origin/${{ github.base_ref || 'main' }}"
build_doc:
name: Build documentation
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v6
- name: Build API documentation package
uses: leanprover/lean-action@v1
with:
lake-package-directory: 'docs/api'
- name: Restore lake cache
uses: actions/cache/restore@v5
with:
path: |
.lake
docs/verso/.lake
key: docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }}-${{ github.sha }}
restore-keys: |
docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }}
- name: Build documentation package
uses: leanprover/lean-action@v1
with:
build-args: '--wfail'
lake-package-directory: 'docs/verso'
use-github-cache: false
- name: Build documentation
run: ./generate.sh
working-directory: docs/verso
- name: Save lake cache
uses: actions/cache/save@v5
with:
path: |
.lake
docs/verso/.lake
key: docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }}-${{ github.sha }}
- name: Check for broken links
uses: lycheeverse/lychee-action@v2
with:
args: --offline --no-progress --exclude-path '.*/find/.*' docs/verso/_out/
fail: true
build_python:
needs: build_and_test_lean
name: Build and test Python
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python_version: [3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./StrataPython/Tools/strata-python
- name: Restore Lean build cache
# The cache is safe to use here because we just saved it for this exact SHA
# in the build_and_test_lean job from ci.yml
# https://github.com/strata-org/Strata/issues/952
uses: ./.github/actions/restore-lake-cache
with:
path: |
.lake
StrataCLI/.lake
StrataPython/.lake
fail-on-cache-miss: "true"
use-restore-keys: "false"
- name: Install Lean (for lake env)
uses: leanprover/lean-action@v1
with:
auto-config: false
build: false
use-github-cache: false
- name: Install cvc5
uses: ./.github/actions/install-cvc5
with:
install-to: system
- name: Install z3
shell: bash
run: |
pip install z3-solver
Z3_PATH=$(python -c "import z3; import os; print(os.path.join(os.path.dirname(z3.__file__), 'lib', 'z3'))")
sudo cp "$Z3_PATH" /usr/local/bin/z3 || true
# Fallback: install from GitHub release
if ! command -v z3 &> /dev/null; then
wget https://github.com/Z3Prover/z3/releases/download/z3-4.13.4/z3-4.13.4-x64-glibc-2.35.zip
unzip z3-4.13.4-x64-glibc-2.35.zip
sudo cp z3-4.13.4-x64-glibc-2.35/bin/z3 /usr/local/bin/
fi
- name: Run PySpec and dispatch tests
run: PYTHON=python lake test
working-directory: StrataPython
- name: Run test script
run: FAIL_FAST=1 ./scripts/run_cpython_tests.sh ${{ matrix.python_version }}
working-directory: StrataPython/Tools/strata-python
cbmc:
needs: build_and_test_lean
permissions:
contents: read
uses: ./.github/workflows/cbmc.yml