Pyodide/wasm support: pure-Python wheel, worker transport, GlowScript host factory #610
This file contains hidden or 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: Test/build | |
| on: | |
| workflow_dispatch: # Allows manual triggering | |
| push: # only build on pusheess to the main branch | |
| branches: | |
| - master | |
| pull_request: | |
| # Stop current actions if there is a new push to the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| max-parallel: 4 | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.11, 3.12] | |
| platform: [ubuntu-latest, macos-latest, windows-latest] | |
| # The include below adds jobs on older versions of python, | |
| # but just on one platform. Windows is probably the most widely | |
| # used for vpython, so test on that. | |
| include: | |
| - python-version: "3.8" | |
| platform: windows-latest | |
| - python-version: "3.9" | |
| platform: windows-latest | |
| - python-version: "3.10" | |
| platform: windows-latest | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Get pip cache location | |
| id: pip-cache | |
| run: | | |
| python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.pip-cache.outputs.dir }} | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest Cython wheel build | |
| - name: Build sdist and wheel | |
| run: | | |
| python -m build | |
| - name: Install vpython | |
| run: | | |
| pip install . | |
| - name: Run tests | |
| run: | | |
| pytest vpython | |
| - name: Import test | |
| run: | | |
| python -c "import vpython" | |
| build_aarch64: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # cp38 dropped: Python 3.8 is EOL and its leg fails outright. | |
| python-version: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] | |
| runs-on: ubuntu-latest | |
| env: | |
| py: /opt/python/${{ matrix.python-version }}/bin/python | |
| # manylinux_2_28, not manylinux2014: cbor2 (a hard dependency via | |
| # autobahn) ships only manylinux_2_28 aarch64 wheels for cp311+, so the | |
| # 2014 (glibc 2.17) container can't use them and falls back to a | |
| # from-source C build that fails under QEMU. | |
| img: quay.io/pypa/manylinux_2_28_aarch64 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up QEMU | |
| id: qemu | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build and Test | |
| run: | | |
| docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \ | |
| ${{ env.img }} \ | |
| bash -exc '${{ env.py }} -m venv .env && \ | |
| source .env/bin/activate && \ | |
| echo -e "\e[1;34m Install dependencies \e[0m" && \ | |
| python -m pip install --upgrade pip && \ | |
| pip install pytest Cython wheel build && \ | |
| echo -e "\e[1;34m Build wheel \e[0m" && \ | |
| python -m build && \ | |
| echo -e "\e[1;34m Install vpython \e[0m" && \ | |
| pip install . && \ | |
| echo -e "\e[1;34m Run tests \e[0m" && \ | |
| pytest vpython && \ | |
| echo -e "\e[1;34m Import test \e[0m" && \ | |
| python -c "import vpython" && \ | |
| deactivate' |