Skip to content

changes required for emscripten-3.173 #467

changes required for emscripten-3.173

changes required for emscripten-3.173 #467

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
pull_request:
defaults:
run:
shell: bash -l {0}
jobs:
test-browser:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- emsdk_ver: "3.1.45"
python_version: "3.11"
pybind11_version: "<2.12.0"
# - emsdk_ver: "3.1.58"
# python_version: "3.12"
# pybind11_version: ""
steps:
- uses: actions/checkout@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev_${{matrix.emsdk_ver}}.yml
environment-name: pyjs-wasm
condarc: |
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge
- name: Install Playwright
run: |
playwright install
- name: Build pyjs
run: |
micromamba activate pyjs-wasm
# emsdk activate ${{matrix.emsdk_ver}}
# source $(pwd)/emsdk_install/emsdk_env.sh
micromamba create -n pyjs-build-wasm \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
python=${{matrix.python_version}} "pybind11${{matrix.pybind11_version}}" nlohmann_json pybind11_json "numpy<2" "pytest==7.1.1" bzip2 sqlite zlib zstd libffi exceptiongroup emscripten-abi==${{matrix.emsdk_ver}}
mkdir build
pushd build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
# build pyjs
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DBUILD_RUNTIME_BROWSER=ON \
-DBUILD_RUNTIME_NODE=OFF \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
..
make -j2
make install
popd
- name: setup env with numpy
run: |
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
"python=${{matrix.python_version}}" "pytest==7.1.1" "numpy<2" exceptiongroup
- name: Test in browser-main
run: |
micromamba activate pyjs-wasm
pyjs_code_runner run script \
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.11/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main
- name: Test in browser-worker
run: |
micromamba activate pyjs-wasm
pyjs_code_runner run script \
browser-worker \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.11/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main
- name: setup minimal env without numpy
run: |
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
"python=${{matrix.python_version}}" "pytest==7.1.1" exceptiongroup
- name: Test in browser-main-no-numpy
run: |
micromamba activate pyjs-wasm
pyjs_code_runner run script \
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.11/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main \
--no-cache