Skip to content

Merge pull request #63 from SVF-tools/copilot/fix-stubtest-3-9-failure #260

Merge pull request #63 from SVF-tools/copilot/fix-stubtest-3-9-failure

Merge pull request #63 from SVF-tools/copilot/fix-stubtest-3-9-failure #260

Workflow file for this run

name: Run Notebooks using Built pysvf
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
execute-notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake gcc g++ python3-dev nodejs
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install wheel pybind11 notebook nbconvert nbclient ipykernel build
- name: Register Jupyter kernel
run: |
python -m ipykernel install --user --name python3
- name: Install svf-lib and set environment variables
run: |
npm install svf-lib
echo "SVF_DIR=$PWD/node_modules/svf-lib/SVF-linux-x86_64" >> $GITHUB_ENV
echo "LLVM_DIR=$PWD/node_modules/llvm-21.1.0.obj" >> $GITHUB_ENV
echo "Z3_DIR=$PWD/node_modules/z3.obj" >> $GITHUB_ENV
- name: Get system architecture
id: get_arch
run: |
echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
- name: Build and install pysvf
run: |
echo "Event: ${{ github.event_name }}"
echo "Ref: ${{ github.ref }}"
echo "SHA: ${{ github.sha }}"
rm -rf build dist pysvf.egg-info
export PYBIND11_DIR=$(python3 -m pybind11 --cmakedir)
export CMAKE_BUILD_TYPE=Release
# Fake version for dev notebook CI
sed -i.bak "s/version=.*,/version='0.0.0.dev0',/" setup.py
if [[ "$(uname)" == "Linux" ]]; then
SVF_DIR=${SVF_DIR} LLVM_DIR=${LLVM_DIR} Z3_DIR=${Z3_DIR} PYBIND11_DIR=${PYBIND11_DIR} \
python3 -m build --wheel
else
echo "Unsupported platform"
exit 1
fi
pip install dist/*.whl
- name: Run notebooks under demo/
run: |
cd demo
for nb in $(find . -name "*.ipynb"); do
echo "Executing $nb..."
jupyter nbconvert --to notebook --execute "$nb" --stdout > /dev/null
done