Add Firefox for testing #121
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] | |
env: | |
FORCE_COLOR: 3 | |
permissions: | |
contents: read | |
concurrency: | |
group: main-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
env: | |
DISPLAY: :99 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
pyodide-version: [0.26.4] | |
test-config: | |
[ | |
{ runner: selenium, runtime: chrome, runtime-version: latest }, | |
{ runner: selenium, runtime: firefox, runtime-version: latest }, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- uses: pyodide/pyodide-actions/download-pyodide@v1 | |
with: | |
version: ${{ matrix.pyodide-version }} | |
to: dist | |
# - uses: pyodide/pyodide-actions/install-browser@v1 | |
# with: | |
# runner: ${{ matrix.test-config.runner }} | |
# browser: ${{ matrix.test-config.runtime }} | |
# browser-version: ${{ matrix.test-config.runtime-version }} | |
- uses: browser-actions/[email protected] | |
if: ${{ matrix.test-config.runtime == 'chrome' }} | |
with: | |
# November 2021, 2024 LTS release | |
chrome-version: 126 | |
install-chromedriver: true | |
- uses: browser-actions/[email protected] | |
if: ${{ matrix.test-config.runtime == 'firefox' }} | |
with: | |
firefox-version: ${{ matrix.test-config.runtime-version }} | |
- uses: browser-actions/setup-geckodriver@latest | |
if: ${{ matrix.test-config.runtime == 'firefox' }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install requirements | |
shell: bash -l {0} | |
run: | | |
python3 -m pip install -e .[test] | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
pytest -v \ | |
--cov=matplotlib_pyodide \ | |
--dist-dir=./dist/ \ | |
--runner=${{ matrix.test-config.runner }} \ | |
--rt ${{ matrix.test-config.runtime }} | |
- uses: codecov/codecov-action@v3 | |
if: ${{ github.event.repo.name == 'pyodide/matplotlib-pyodide' || github.event_name == 'pull_request' }} | |
with: | |
fail_ci_if_error: false | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
environment: PyPi-deploy | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- 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 }} |