diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fc3b6e1..09ba4d2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -41,52 +41,21 @@ permissions: contents: read jobs: - # separate job needed to setup the correct version of python and github os for pyodide version - get_versions: - runs-on: ubuntu-latest - name: Set python/os version (${{inputs.pyodide-version}},${{inputs.os}}) - outputs: - os: ${{ steps.fix_runner_os.outputs.os }} - python: ${{ steps.get_python_version.outputs.python }} - pythonexec: ${{ steps.get_python_version.outputs.pythonexec }} - steps: - - name: Get python version for a particular pyodide version - id: get_python_version - run: | - case "${{inputs.pyodide-version}}" in - *) - echo "python=3.10.2" >> $GITHUB_OUTPUT - echo "pythonexec=python310" >> $GITHUB_OUTPUT - echo "Using python 3.10.2 for pyodide ${{inputs.pyodide-version}}" - ;; - esac - - name: Fix runner os - id: fix_runner_os - run: | - if [[ "${{ steps.get_python_version.outputs.python }}" == "3.10.2" && "${{inputs.os}}" == ubuntu* && "${{inputs.os}}" != ubuntu-20.04 ]] - then - echo "Fixing ubuntu version ${{ inputs.os }} to ubuntu-20.04 for python 3.10.2" - echo "os=ubuntu-20.04" >> $GITHUB_OUTPUT - else - echo "Using existing OS: ${{inputs.os}} for python ${{ steps.get_python_version.outputs.python }}" - echo "os=${{inputs.os}}" >> $GITHUB_OUTPUT - fi test: - name: test ${{ inputs.browser }} ( ${{ inputs.runner }},${{ needs.get_versions.outputs.os }},pyodide:${{ inputs.pyodide-version}}) - needs: get_versions - runs-on: ${{ needs.get_versions.outputs.os }} + name: test ${{ inputs.browser }} (${{ inputs.runner }}, pyodide:${{ inputs.pyodide-version}}) + runs-on: ubuntu-latest env: DISPLAY: :99 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: - python-version: ${{ needs.get_versions.outputs.python }} + python-version: 3.12 - name: Install node uses: actions/setup-node@v3 if: ${{ contains(inputs.browser, 'node') || inputs.runner == 'playwright' }} with: - node-version: ${{ inputs.node-version }} + node-version: ${{ inputs.browser-version }} - name: Cache Playwright browsers uses: actions/cache@v3 @@ -101,12 +70,12 @@ jobs: run: | if [ -n "${{ inputs.playwright-version }}" ] then - ${{needs.get_versions.outputs.pythonexec}} -m pip install playwright==${{inputs.playwright-version}} + python -m pip install playwright==${{inputs.playwright-version}} else - ${{needs.get_versions.outputs.pythonexec}} -m pip install playwright + python -m pip install playwright fi # TODO: install only browsers that are required - ${{needs.get_versions.outputs.pythonexec}} -m playwright install --with-deps + python -m playwright install --with-deps - uses: pyodide/pyodide-actions/download-pyodide@v1 with: @@ -118,7 +87,7 @@ jobs: runner: ${{ inputs.runner }} browser: ${{ inputs.browser }} browser-version: ${{ inputs.browser-version }} - playwright-version: ${{ inputs.runner-version }} + playwright-version: ${{ inputs.playwright-version }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download build artifacts from calling package @@ -131,7 +100,7 @@ jobs: - name: install pyodide-py shell: bash -l {0} run: | - ${{needs.get_versions.outputs.pythonexec}} -m pip install pyodide-py==${{inputs.pyodide-version}} + python -m pip install pyodide-py==${{inputs.pyodide-version}} - name: Install pytest-pyodide @@ -141,10 +110,9 @@ jobs: # Currently we only install the package for dependencies. # We then uninstall it otherwise tests fails due to pytest hook being # registered twice. - # temporarily pin pytest version (https://github.com/pyodide/pytest-pyodide/pull/133#issuecomment-2081412407) - ${{needs.get_versions.outputs.pythonexec}} -m pip install ".[test]" "pytest<8.0.0" + python -m pip install ".[test]" else - ${{needs.get_versions.outputs.pythonexec}} -m pip install pytest-pyodide + python -m pip install pytest-pyodide fi - name: Run tests shell: bash -l {0} diff --git a/.github/workflows/testall.yaml b/.github/workflows/testall.yaml index aa80088..dd3f3e1 100644 --- a/.github/workflows/testall.yaml +++ b/.github/workflows/testall.yaml @@ -38,7 +38,7 @@ on: required: false type: string default: "" - playwright-version: + playwright-versions: required: false type: string default: "" # latest diff --git a/utils/build_test_matrix.py b/utils/build_test_matrix.py index 184c28f..e55a1fa 100644 --- a/utils/build_test_matrix.py +++ b/utils/build_test_matrix.py @@ -7,7 +7,7 @@ import itertools import json -DEFAULT_OS = "ubuntu-20.04, macos-11" +DEFAULT_OS = "ubuntu-latest, macos-latest" DEFAULT_RUNNER = "selenium, playwright" DEFAULT_BROWSER = "chrome, firefox, node, safari, host" DEFAULT_CHROME_VERSION = "latest"