This repository was archived by the owner on Jan 19, 2025. It is now read-only.
added a file to sandbox #17
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: Run Tests | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: Python ${{ matrix.python-version }} • ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
# python-version: [3.7, 3.8, 3.9] | |
# os: [windows-latest] | |
exclude: | |
- os: macos-latest | |
python-version: 3.7 | |
- os: windows-latest | |
python-version: 3.7 | |
- os: macos-latest | |
python-version: 3.8 | |
- os: windows-latest | |
python-version: 3.8 | |
- os: macos-latest | |
python-version: 3.9 | |
- os: windows-latest | |
python-version: 3.9 | |
steps: | |
- run: echo ${{github.ref}} | |
- uses: actions/checkout@v2 | |
- name: Set up FFmpeg | |
uses: FedericoCarboni/setup-ffmpeg@v3 | |
with: | |
architecture: x64 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.arch }} | |
- name: Setup Python dependencies | |
run: | | |
python -m pip install -U pip setuptools wheel | |
pip install -r tests/requirements.txt pytest-github-actions-annotate-failures | |
pip install pytest-github-actions-annotate-failures | |
- name: Install ffmpegio package | |
run: pip install -q . | |
- name: Run tests | |
run: pytest -vv | |
distribute: | |
name: Distribution | |
runs-on: ubuntu-latest | |
needs: tests | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
- name: Setup Python dependencies | |
run: | | |
python -m pip install -U pip setuptools | |
pip install -U build | |
- name: Build a binary wheel and a source tarball | |
run: python -m build --sdist --wheel --outdir dist/ . | |
- name: add python distribution files to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Publish distribution 📦 to Test PyPI | |
# uses: pypa/gh-action-pypi-publish@master | |
# with: | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
# skip_existing: true | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |