Test with Pyodide 0.27.2 #637
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: main | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
concurrency: | |
group: main-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 3 | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: [check-integration-test-trigger] | |
env: | |
DISPLAY: :99 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
pyodide-version: ["0.27.2"] | |
test-config: [ | |
# FIXME: recent version of chrome gets timeout | |
{ runner: selenium, runtime: chrome, runtime-version: "125" }, | |
{ runner: selenium, runtime: node, runtime-version: "22" }, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- uses: pyodide/pyodide-actions/download-pyodide@v2 | |
with: | |
version: ${{ matrix.pyodide-version }} | |
to: dist | |
- uses: pyodide/pyodide-actions/install-browser@v2 | |
with: | |
runner: ${{ matrix.test-config.runner }} | |
browser: ${{ matrix.test-config.runtime }} | |
browser-version: ${{ matrix.test-config.runtime-version }} | |
- name: Install requirements | |
shell: bash -l {0} | |
run: | | |
python3 -m pip install -e .[test] | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
pytest -v tests \ | |
--cov=micropip \ | |
--durations=10 \ | |
--dist-dir=./dist/ \ | |
--maxfail=15 \ | |
--runner=${{ matrix.test-config.runner }} \ | |
--rt ${{ matrix.test-config.runtime }} | |
- name: Run integration tests | |
if: needs.check-integration-test-trigger.outputs.run-integration-test | |
shell: bash -l {0} | |
run: | | |
pytest -v tests/integration \ | |
--integration \ | |
--cov=micropip \ | |
--durations=10 \ | |
--dist-dir=./dist/ \ | |
--maxfail=15 \ | |
--runner=${{ matrix.test-config.runner }} \ | |
--rt ${{ matrix.test-config.runtime }} | |
- uses: codecov/codecov-action@v5 | |
if: ${{ github.event.repo.name == 'pyodide/micropip' || github.event_name == 'pull_request' }} | |
with: | |
fail_ci_if_error: false | |
check-integration-test-trigger: | |
name: test-integration-test-trigger | |
runs-on: ubuntu-latest | |
outputs: | |
run-integration-test: ${{ steps.check-integration-test-trigger.outputs.trigger }} | |
steps: | |
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb # v4.2.2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- id: check-integration-test-trigger | |
name: Check integration test trigger | |
shell: bash | |
run: | | |
set -e -x | |
COMMIT_MSG=$(git log --no-merges -1 --oneline) | |
# The integration tests will be triggered on push or on pull_request when the commit | |
# message contains "[integration]" or if it is pushed to main branch. | |
if [[ "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main || | |
"$COMMIT_MSG" =~ \[integration\] ]]; then | |
echo "trigger=true" >> "$GITHUB_OUTPUT" | |
fi | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
environment: PyPi-deploy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
# IMPORTANT: always build sdist, and then the wheel from | |
# the sdist (like it is currently done here). This is | |
# because we want to ensure that no extra files get | |
# copied, which can be the case with building in-tree. | |
# The MANIFEST.in file ensures that the sdist doesn't | |
# contain any unnecessary files. | |
- name: Install requirements and build wheel | |
shell: bash -l {0} | |
run: | | |
python -m pip install build twine | |
python -m build . | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |