Karl Kroening b76f4933fa Use GitHub Actions for CI.
This sets up GitHub Actions (GHA) to run in place of the
currently broken Travis CI.  Initially, this only covers running
tox/pytest and Black, but may eventually be extended to run pylint,
mypy, flake8, etc. - see #605, for example.

Notes:
* Python 3.10 is not yet supported due to the `collections.Iterable`
  issue discussed in #330, #624, etc.
* The Black CI step acts as a linting step, rather than attempting to
  have the GHA job automatically update/commit/push the reformarted
  code.
* Black is currently pinned to an older version that supports
  `--target-version py27` until Python 2 compatibility can be dropped in
  the final Python 2 compatibility release of ffmpeg-python.
* Only the main source directory (`ffmpeg/`) is checked with Black at
  the moment.  The `examples/` directory should also be checked, but
  will be done as a separate PR.
2022-03-06 15:24:06 -08:00

45 lines
1.2 KiB
YAML

name: CI
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# - "3.10" # FIXME: broken due to `collections.Iterable` issue; see #330 / #624 / etc.
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install ffmpeg
run: |
sudo apt update
sudo apt install ffmpeg
- name: Setup pip + tox
run: |
python -m pip install --upgrade \
"pip==20.3.4; python_version < '3.6'" \
"pip==21.3.1; python_version >= '3.6'"
python -m pip install tox==3.24.5 tox-gh-actions==2.9.1
- name: Test with tox
run: tox
black:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: psf/black@21.12b0 # TODO: upgrade after dropping Python 2 support.
with:
src: ffmpeg # TODO: also format `examples`.
version: 21.12b0