-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (187 loc) · 6.32 KB
/
Copy pathci.yml
File metadata and controls
193 lines (187 loc) · 6.32 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
name: Build
on:
pull_request:
merge_group:
push:
branches: [main]
jobs:
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: strata-org/Strata/.github/actions/install-cvc5@main
- name: Install z3
uses: strata-org/Strata/.github/actions/install-z3@main
- 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
- name: Build StrataPython and compile-time tests
# Building StrataPythonTest runs the compile-time test suite: the tests
# are `#guard_msgs` / `#eval` checks that execute during elaboration.
# This also resolves the `Strata` git dependency, cloning it into
# `.lake/packages/Strata`.
uses: leanprover/lean-action@v1
with:
build-args: StrataPython StrataPythonTest
use-github-cache: false
test: false
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Build using pip
# `strata-base` (Tools/Python-base) and `strata-python` (Tools/strata-python)
# both live in this repo.
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
- name: Run pyInterpret golden-file tests
working-directory: StrataPythonTest
shell: bash
run: ./run_py_interpret.sh
- name: Run pyAnalyze SARIF tests
working-directory: StrataPythonTest
shell: bash
run: python run_py_analyze_sarif.py
- name: Run pyAnalyze golden-file tests
working-directory: StrataPythonTest
shell: bash
run: ./run_py_analyze.sh
- name: Run regex differential tests
working-directory: StrataPythonTest/Regex
run: python diff_test.py
- name: Save lake cache
uses: ./.github/actions/save-lake-cache
with:
path: .lake
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: 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
fail-on-cache-miss: "true"
use-restore-keys: "false"
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
- name: Install Lean
uses: leanprover/lean-action@v1
with:
auto-config: false
build: false
- name: Install cvc5
uses: strata-org/Strata/.github/actions/install-cvc5@main
with:
install-to: system
- name: Check pending tests for newly passing
working-directory: 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: strata-org/Strata/.github/actions/check-copyright-headers@main
- name: Check for trailing whitespace
uses: strata-org/Strata/.github/actions/lint-whitespace@main
with:
directory: .
- name: Check for import Lean
uses: strata-org/Strata/.github/actions/check-lean-import@main
- name: Check for new panic! usage
uses: strata-org/Strata/.github/actions/check-no-panic@main
with:
base-ref: "origin/${{ github.base_ref || 'main' }}"
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: 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
fail-on-cache-miss: "true"
use-restore-keys: "false"
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
- 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: strata-org/Strata/.github/actions/install-cvc5@main
with:
install-to: system
- name: Install z3
uses: strata-org/Strata/.github/actions/install-z3@main
with:
install-to: system
- name: Run PySpec and dispatch tests
# Excludes the CPython differential test, which is run separately below
# against a full CPython checkout; here it would be a no-op anyway since
# CPYTHON_DIR is unset.
run: PYTHON=python lake test -- --exclude CpythonDiffTest
- name: Run CPython differential tests
# Clones CPython at the matrix version and round-trips its whole test
# suite through the Strata generator + Ion (de)serializer. The round-trip
# check runs in-process inside the StrataPythonTestExtra/CpythonDiffTest
# Lean test (driven by this script), so no separate `strata` CLI is built.
run: FAIL_FAST=1 ./scripts/run_cpython_tests.sh ${{ matrix.python_version }}
working-directory: Tools/strata-python
cbmc:
needs: build_and_test_lean
permissions:
contents: read
uses: ./.github/workflows/cbmc.yml