mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
68 lines
2 KiB
YAML
68 lines
2 KiB
YAML
name: Pyodide Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup packages
|
|
run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv
|
|
|
|
- name: Create venv
|
|
run: python3 -m venv ~/env
|
|
|
|
- name: Install pyodide
|
|
run: ~/env/bin/pip install pyodide-build pyodide-cli
|
|
|
|
- name: Configure CMake and build
|
|
run: |
|
|
git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
|
|
cd ~/emsdk && PYODIDE_EMSCRIPTEN_VERSION=$(~/env/bin/pyodide config get emscripten_version)
|
|
./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION}
|
|
./emsdk activate ${PYODIDE_EMSCRIPTEN_VERSION}
|
|
|
|
- name: Build Z3
|
|
run: |
|
|
source ~/emsdk/emsdk_env.sh
|
|
cd src/api/python
|
|
CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAG="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive
|
|
env:
|
|
CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -pthread -s USE_PTHREADS=1 -g2 -s SAFE_HEAP=0 -s PTHREAD_POOL_SIZE=0 -s PTHREAD_POOL_SIZE_STRICT=0"
|
|
LDFLAGS: "-fexceptions -s WASM_BIGINT -s -pthread -s USE_PTHREADS=1"
|
|
CXXFLAGS: "-fexceptions -pthread -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0"
|
|
|
|
- name: Setup env-pyodide
|
|
run: |
|
|
source ~/env/bin/activate
|
|
source ~/emsdk/emsdk_env.sh
|
|
pyodide venv ~/env-pyodide
|
|
|
|
- name: Setup z3 wheel
|
|
run: |
|
|
~/env-pyodide/bin/pip install src/api/python/dist/*.whl
|
|
~/env-pyodide/bin/python - <src/api/python/z3test.py z3
|
|
|
|
- name: Package wheel
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: pyodide-wheel
|
|
path: src/api/python/dist/*.whl
|
|
retention-days: 1
|
|
|