Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate smoke tests from building #1389

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: smoke
on:
push:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
pull_request:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Packages
run: pip install -r tests/requirements.txt

- name: Linters
run: make lint

nix:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, python: 3.9, ffmpeg: "6.1", extras: true}
- {os: ubuntu-latest, python: 3.9, ffmpeg: "6.0"}
- {os: ubuntu-latest, python: pypy3.9, ffmpeg: "6.1"}
#- {os: macos-13, python: 3.12, ffmpeg: "6.1"}

env:
PYAV_PYTHON: python${{ matrix.config.python }}
PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }}

steps:
- uses: actions/checkout@v4
name: Checkout

- name: Python ${{ matrix.config.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python }}

- name: OS Packages
run: |
case ${{ matrix.config.os }} in
ubuntu-latest)
sudo apt-get update
sudo apt-get install autoconf automake build-essential cmake \
libtool mercurial pkg-config texinfo wget yasm zlib1g-dev
sudo apt-get install libass-dev libfreetype6-dev libjpeg-dev \
libtheora-dev libvorbis-dev libx264-dev
if [[ "${{ matrix.config.extras }}" ]]; then
sudo apt-get install doxygen
fi
;;
macos-13)
brew install automake libtool nasm pkg-config shtool texi2html wget
brew install libass libjpeg libpng libvorbis libvpx opus theora x264
;;
esac

- name: Pip and FFmpeg
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build-deps

- name: Build
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build

- name: Test
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
python -m av --version # Assert it can import.
scripts/test

- name: Docs
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs html

- name: Doctest
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs test

- name: Examples
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/test examples

windows:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, python: 3.9, ffmpeg: "6.1"}
- {os: windows-latest, python: 3.9, ffmpeg: "6.0"}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Conda
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda config --set always_yes true
conda config --add channels conda-forge
conda create -q -n pyav \
cython \
numpy \
pillow \
python=${{ matrix.config.python }} \
setuptools

- name: Build
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python scripts\\fetch-vendor.py --config-file scripts\\ffmpeg-${{ matrix.config.ffmpeg }}.json $CONDA_PREFIX\\Library
python setup.py build_ext --inplace --ffmpeg-dir=$CONDA_PREFIX\\Library

- name: Test
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python setup.py test
151 changes: 1 addition & 150 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,157 +2,8 @@ name: tests
on:
release:
types: [published]
push:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
pull_request:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
workflow_dispatch:
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Packages
run: pip install -r tests/requirements.txt

- name: Linters
run: make lint

nix:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, python: 3.9, ffmpeg: "6.1", extras: true}
- {os: ubuntu-latest, python: 3.9, ffmpeg: "6.0"}
- {os: ubuntu-latest, python: pypy3.9, ffmpeg: "6.1"}
# - {os: macos-latest, python: 3.9, ffmpeg: "6.1"}

env:
PYAV_PYTHON: python${{ matrix.config.python }}
PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }}

steps:
- uses: actions/checkout@v4
name: Checkout

- name: Python ${{ matrix.config.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python }}

- name: OS Packages
run: |
case ${{ matrix.config.os }} in
ubuntu-latest)
sudo apt-get update
sudo apt-get install autoconf automake build-essential cmake \
libtool mercurial pkg-config texinfo wget yasm zlib1g-dev
sudo apt-get install libass-dev libfreetype6-dev libjpeg-dev \
libtheora-dev libvorbis-dev libx264-dev
if [[ "${{ matrix.config.extras }}" ]]; then
sudo apt-get install doxygen
fi
;;
macos-13)
brew install automake libtool nasm pkg-config shtool texi2html wget
brew install libass libjpeg libpng libvorbis libvpx opus theora x264
;;
esac

- name: Pip and FFmpeg
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build-deps

- name: Build
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/build

- name: Test
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
python -m av --version # Assert it can import.
scripts/test

- name: Docs
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs html

- name: Doctest
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
make -C docs test

- name: Examples
if: matrix.config.extras
run: |
. scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }}
scripts/test examples

windows:
name: "py-${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{matrix.config.os}}"
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, python: 3.9, ffmpeg: "6.1"}
- {os: windows-latest, python: 3.9, ffmpeg: "6.0"}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Conda
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda config --set always_yes true
conda config --add channels conda-forge
conda create -q -n pyav \
cython \
numpy \
pillow \
python=${{ matrix.config.python }} \
setuptools

- name: Build
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python scripts\\fetch-vendor.py --config-file scripts\\ffmpeg-${{ matrix.config.ffmpeg }}.json $CONDA_PREFIX\\Library
python setup.py build_ext --inplace --ffmpeg-dir=$CONDA_PREFIX\\Library

- name: Test
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
python setup.py test

package-source:
runs-on: ubuntu-latest
steps:
Expand Down