diff --git a/.github/workflows/emscripten.yaml b/.github/workflows/emscripten.yaml index 9a84d3e12ae..4f12e81c281 100644 --- a/.github/workflows/emscripten.yaml +++ b/.github/workflows/emscripten.yaml @@ -15,44 +15,16 @@ jobs: name: Pyodide wheel runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - - uses: actions/setup-python@v4 + - uses: pypa/cibuildwheel@v2.19 + env: + PYODIDE_BUILD_EXPORTS: whole_archive + CFLAGS: -fexceptions + LDFLAGS: -fexceptions with: - python-version: "3.11" - - - name: Install pyodide-build - run: pip install pyodide-build==0.23.4 - - - name: Compute emsdk version - id: compute-emsdk-version - run: | - # Prepare xbuild environment (side-effect) - pyodide config list - # Save EMSDK version - EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) - echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT - - - uses: mymindstorm/setup-emsdk@v12 - with: - version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }} - actions-cache-folder: emsdk-cache - - - name: Build - run: PYODIDE_BUILD_EXPORTS=whole_archive CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build - working-directory: tests - - - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Set up Pyodide virtual environment - run: | - pyodide venv .venv-pyodide - .venv-pyodide/bin/pip install $(echo -n tests/dist/*.whl) - - - name: Test - run: .venv-pyodide/bin/pytest -o timeout=0 tests/test_*.py + package-dir: tests + only: cp312-pyodide_wasm32 diff --git a/tests/pyproject.toml b/tests/pyproject.toml index 97478b0b826..469c145dfdf 100644 --- a/tests/pyproject.toml +++ b/tests/pyproject.toml @@ -2,10 +2,16 @@ # builder for the tests (yet). Specifically, wheels can't be built from SDists. [build-system] -requires = ["scikit-build-core[pyproject]"] +requires = ["scikit-build-core"] build-backend = "scikit_build_core.build" [project] name = "pybind11_tests" version = "0.0.1" dependencies = ["pytest", "pytest-timeout", "numpy", "scipy"] + +[tool.scikit-build.cmake.define] +PYBIND11_FINDPYTHON = true + +[tool.cibuildwheel] +test-command = "pytest -o timeout=0 -p no:cacheprovider {project}/tests/test_*.py"