Repository navigation
Fix filter graph crashes when linking or adding after configure #1808
Workflow file for this run
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: smoke | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: master | |
| paths-ignore: | |
| - '**.md' | |
| - '**.rst' | |
| - '**.txt' | |
| - '**.pyi' | |
| - '.github/workflows/lint.yml' | |
| - '.github/workflows/tests.yml' | |
| pull_request: | |
| branches: master | |
| paths-ignore: | |
| - '**.md' | |
| - '**.rst' | |
| - '**.txt' | |
| - '**.pyi' | |
| - '.github/workflows/lint.yml' | |
| - '.github/workflows/tests.yml' | |
| jobs: | |
| matrix: | |
| name: Pick Python versions | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| config: ${{ steps.pick.outputs.config }} | |
| steps: | |
| - name: Pick | |
| id: pick | |
| shell: python | |
| run: | | |
| import json, os, random | |
| configs = [ | |
| {"os": "ubuntu-24.04", "ffmpeg": "9.0.2", "extras": True}, | |
| {"os": "ubuntu-24.04", "ffmpeg": "8.1.3"}, | |
| {"os": "ubuntu-24.04", "ffmpeg": "9.0.2"}, | |
| # riscv64 wheels (e.g. Pillow) are often missing on PyPI; RISE | |
| # mirrors prebuilt wheels for it so uv doesn't have to build them | |
| # from source. It also uses a pyav-ffmpeg prebuilt to speed up | |
| # smoke tests. Neither index has cp315 riscv64 wheels yet. | |
| { | |
| "os": "ubuntu-24.04-riscv", | |
| "ffmpeg": "9.0.2", | |
| "prebuilt": True, | |
| "uv-index": "https://pypi.riseproject.dev/simple/", | |
| "pythons": ["3.12", "3.13", "3.14"], | |
| }, | |
| {"os": "macos-15", "ffmpeg": "8.1.3"}, | |
| {"os": "macos-15", "ffmpeg": "9.0.2"}, | |
| ] | |
| pythons = ["3.12", "3.13", "3.14", "3.15"] | |
| # Don't give two jobs with the same OS and FFmpeg the same Python. | |
| taken = set() | |
| for config in configs: | |
| key = (config["os"], config["ffmpeg"]) | |
| choices = [ | |
| py for py in config.pop("pythons", pythons) if (key, py) not in taken | |
| ] | |
| config["python"] = random.choice(choices) | |
| taken.add((key, config["python"])) | |
| with open(os.environ["GITHUB_OUTPUT"], "a") as f: | |
| f.write(f"config={json.dumps(configs)}\n") | |
| nix: | |
| name: "py${{ matrix.config.python }} lib-${{ matrix.config.ffmpeg }} ${{ matrix.config.os }}" | |
| needs: matrix | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: ${{ fromJSON(needs.matrix.outputs.config) }} | |
| env: | |
| PYAV_PYTHON: python${{ matrix.config.python }} | |
| PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }} | |
| # unsafe-best-match is needed so uv still falls back to PyPI for | |
| # packages/versions an extra index doesn't happen to carry. | |
| UV_INDEX: ${{ matrix.config.uv-index || '' }} | |
| UV_INDEX_STRATEGY: ${{ matrix.config.uv-index && 'unsafe-best-match' || 'first-index' }} | |
| # pyav-ffmpeg prebuilt .pc files bake in prefix=/tmp/vendor, so it must | |
| # be extracted there verbatim and pointed at explicitly. | |
| PKG_CONFIG_PATH: ${{ matrix.config.prebuilt && '/tmp/vendor/lib/pkgconfig' || '' }} | |
| LD_LIBRARY_PATH: ${{ matrix.config.prebuilt && '/tmp/vendor/lib' || '' }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| name: Checkout | |
| - name: Python ${{ matrix.config.python }} | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| activate-environment: true | |
| python-version: ${{ matrix.config.python }} | |
| - name: OS Packages | |
| run: | | |
| case ${{ runner.os }} in | |
| Linux) | |
| packages="build-essential pkg-config zlib1g-dev" | |
| if [[ "${{ matrix.config.prebuilt }}" ]]; then | |
| # libxcb-shape0 is needed for the prebuilt's X11 usage. | |
| packages="$packages libxcb-shape0" | |
| else | |
| packages="$packages autoconf automake cmake libtool libx264-dev nasm" | |
| fi | |
| if [[ "${{ matrix.config.extras }}" ]]; then | |
| packages="$packages doxygen" | |
| fi | |
| sudo apt-get update | |
| sudo apt-get install -y $packages | |
| ;; | |
| macOS) | |
| brew install automake libtool opus x264 | |
| ;; | |
| esac | |
| - name: Pip and FFmpeg | |
| run: | | |
| . scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }} | |
| if [[ "${{ matrix.config.prebuilt }}" ]]; then | |
| python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor | |
| else | |
| scripts/build-deps | |
| fi | |
| - name: Build | |
| run: | | |
| [ "${{ runner.os }}" = "macOS" ] && export ARCHFLAGS="-arch $(uname -m)" | |
| . 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. | |
| make 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.12", ffmpeg: "latest"} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - 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 config --add channels scientific-python-nightly-wheels | |
| conda create -q -n pyav \ | |
| numpy \ | |
| pillow \ | |
| pytest \ | |
| python=${{ matrix.config.python }} \ | |
| setuptools \ | |
| cython | |
| - 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 -m pytest | |
| armv7: | |
| name: "armv7 cross-build + qemu smoke" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Install build tooling | |
| run: | | |
| uv venv --seed --python 3.12 .venv-3.12 | |
| uv venv --seed --python 3.14t .venv-3.14t | |
| uv pip install --python .venv-3.12/bin/python -U "cython>=3.1.0,<4" "setuptools>=77.0" wheel | |
| uv pip install --python .venv-3.14t/bin/python -U "cython>=3.1.0,<4" "setuptools>=77.0" wheel | |
| # patchelf 0.18 (ubuntu-24.04's system version) corrupts ELF files | |
| # with large p_align; pin <0.18 for auditwheel to use. | |
| uv pip install --python .venv-3.12/bin/python -U ziglang auditwheel 'patchelf<0.18' | |
| - name: Cross-compile armv7l wheels with zig | |
| env: | |
| HOST_PY312: .venv-3.12/bin/python | |
| HOST_PY314T: .venv-3.14t/bin/python | |
| TOOLS_PY: .venv-3.12/bin/python | |
| run: bash scripts/build-armv7l-cross.sh | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: arm | |
| - name: Import-test wheels under emulation | |
| run: | | |
| docker run --rm --platform linux/arm/v7 -v "$PWD/dist:/dist:ro" \ | |
| quay.io/pypa/manylinux_2_31_armv7l bash -ceu ' | |
| for py in /opt/python/cp312-cp312 /opt/python/cp314-cp314t; do | |
| echo "::group::$("$py/bin/python" --version)" | |
| "$py/bin/pip" install --no-index --find-links /dist av | |
| "$py/bin/python" -m av --version | |
| echo "::endgroup::" | |
| done' |