Skip to content

Improve finding rotation from metadata. #49

Improve finding rotation from metadata.

Improve finding rotation from metadata. #49

name: Unittests & Auto-publish
# Allow to trigger the workflow manually (e.g. when deps changes)
on: [push, workflow_dispatch]
concurrency:
# concurrency at the workflow level so the multiple matrix don't interfere each others
group: ${{ github.workflow }}-${{ github.ref }}
# Do not cancel the main branch (to make sure the publish job is never interupted)
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
pytest-job:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.8', '3.x']
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update
- run: sudo apt-get install -y ffmpeg
# Install deps
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip --version
- run: pip install -e .[dev]
- run: pip freeze
# Run tests (in parallel)
- name: Run core tests
run: pytest -vv -n auto
# Auto-publish when version is increased
publish-job:
# Only try to publish if:
# * Repo is self (prevents running from forks)
# * Branch is `main`
if: |
github.repository == 'google/mediapy'
&& github.ref == 'refs/heads/main'
needs: pytest-job # Only publish after tests are successful
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30
steps:
# Publish the package (if local `__version__` > pip version)
- uses: etils-actions/pypi-auto-publish@v1
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
parse-changelog: false
# TODO(epot): Could also add steps for `update_docs_in_github.sh`