Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cbmc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cd cbmc-src
STRATA="$GITHUB_WORKSPACE/.lake/packages/Strata"
git apply "$GITHUB_WORKSPACE/StrataPythonTest/cbmc-string-support.patch"
git apply "$STRATA/StrataTest/Languages/Laurel/cbmc-bounds-check.patch"
git apply "$STRATA/StrataTest/Languages/Laurel/CBMC/cbmc-bounds-check.patch"
git apply "$STRATA/StrataTest/Backends/CBMC/cbmc-regex-support.patch"
git apply "$STRATA/StrataTest/Backends/CBMC/cbmc-quantifier-simplify.patch"
export CCACHE_BASEDIR=$PWD
Expand All @@ -68,5 +68,5 @@ jobs:
- name: Run Python CBMC pipeline tests
shell: bash
run: |
pip install ./Tools/Python-base ./Tools/strata-python
pip install ./.lake/packages/StrataDDM/Python/strata ./Python/strata-python
./StrataPythonTest/run_py_cbmc_tests.sh
51 changes: 24 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,43 @@ jobs:
uses: strata-org/Strata/.github/actions/install-cvc5@main
- name: Install z3
uses: strata-org/Strata/.github/actions/install-z3@main
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- 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`.
- name: Build StrataPython library
# Build the library first to resolve git dependencies (populates
# .lake/packages/Strata and .lake/packages/StrataDDM).
uses: leanprover/lean-action@v1
with:
build-args: StrataPython StrataPythonTest
build-args: StrataPython
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.
- name: Install Python packages
# Install after the Lean build so .lake/packages/StrataDDM is available.
# StrataPythonTest/CI/InterpretTests.lean calls Python at compile time.
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
pip install ./.lake/packages/StrataDDM/Python/strata ./Python/strata-python
- name: Build compile-time tests
# Building StrataPythonTest runs the compile-time test suite: the tests
# are `#guard_msgs` / `#eval` checks that execute during elaboration.
run: lake build StrataPythonTest
env:
PYTHON: 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:
Expand Down Expand Up @@ -89,8 +85,7 @@ jobs:
use-restore-keys: "false"
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
pip install ./.lake/packages/StrataDDM/Python/strata ./Python/strata-python
- name: Install Lean
uses: leanprover/lean-action@v1
with:
Expand Down Expand Up @@ -157,8 +152,7 @@ jobs:
use-restore-keys: "false"
- name: Build using pip
run: |
pip install ./Tools/Python-base
pip install ./Tools/strata-python
pip install ./.lake/packages/StrataDDM/Python/strata ./Python/strata-python
- name: Install Lean (for lake env)
uses: leanprover/lean-action@v1
with:
Expand All @@ -183,8 +177,11 @@ jobs:
# 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
run: |
VER=${{ matrix.python_version }}
git clone https://github.com/python/cpython.git --branch "$VER" --depth 1 "cpython-$VER"
FAIL_FAST=1 ./scripts/run_cpython_tests.sh "$VER"
working-directory: Python/strata-python

cbmc:
needs: build_and_test_lean
Expand Down
4 changes: 2 additions & 2 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "7b40c42a9f279ef6aaa9000cfd8d728476c953fa",
"rev": "7ba6debc4d2e9637c4a8bd86be0ed91126633856",
"name": "Strata",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All @@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "fbd9f71d6f03f56d71dc0ea4c40fcca7f4ebb6f8",
"rev": "18c1ade5cd00b4c955d5b9f341ab70d5573f27ba",
"name": "StrataDDM",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand Down
10 changes: 3 additions & 7 deletions lakefile.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StrataPython"
version = "0.1.0"
defaultTargets = ["StrataPython"]
testDriver = "StrataTestMain"
testDriver = "StrataPythonFrontEndTestMain"

[[require]]
name = "Strata"
Expand All @@ -10,7 +10,7 @@ rev = "main"

[[input_file]]
name = "PythonDialectIon"
path = "Tools/strata-python/dialects/Python.dialect.st.ion"
path = "Python/strata-python/dialects/Python.dialect.st.ion"
text = true

[[lean_lib]]
Expand All @@ -26,13 +26,9 @@ name = "StrataPythonTestExtra"
globs = ["StrataPythonTestExtra.+"]

[[lean_exe]]
name = "StrataTestMain"
name = "StrataPythonFrontEndTestMain"
needs = ["StrataPython", "StrataPythonTest"]

[[lean_exe]]
name = "DiffTestCore"
needs = ["StrataPython"]

[[lean_exe]]
name = "pyAnalyzeLaurel"
root = "Scripts.pyAnalyzeLaurel"
Expand Down
Loading