Release 2.4.0 #431
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
emsdk_ver: ["3.1.58"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment-dev.yml | |
environment-name: pyjs-wasm | |
- name: Install Playwright | |
run: | | |
playwright install | |
- name: Setup emsdk | |
shell: bash -el {0} | |
run: | | |
./emsdk/setup_emsdk.sh ${{ matrix.emsdk_ver }} $(pwd)/emsdk_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 pybind11 nlohmann_json pybind11_json numpy "pytest==7.1.1" bzip2 sqlite zlib zstd libffi exceptiongroup | |
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 "pytest==7.1.1" numpy 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 "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 |