diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 74cd42ad0..44f1ac833 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -43,15 +43,29 @@ jobs: fail-fast: false matrix: config: - - {os: ubuntu-24.04, python: "3.14", ffmpeg: "9.0.1", extras: true} - - {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.1.2"} - - {os: ubuntu-24.04, python: "3.13", ffmpeg: "9.0.1"} - - {os: macos-14, python: "3.12", ffmpeg: "8.1.2"} - - {os: macos-14, python: "3.14", ffmpeg: "9.0.1"} + - {os: ubuntu-24.04, python: "3.14", ffmpeg: "9.0.1", ffmpeg_config: ffmpeg-latest.json, extras: true} + - {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.1.2", ffmpeg_config: ffmpeg-8.1.json} + - {os: ubuntu-24.04, python: "3.13", ffmpeg: "9.0.1", ffmpeg_config: ffmpeg-latest.json} + - {os: ubuntu-24.04-riscv, python: "3.14", ffmpeg: "9.0.1", ffmpeg_config: ffmpeg-latest.json, extras: true} + - {os: ubuntu-24.04-riscv, python: "3.12", ffmpeg: "8.1.2", ffmpeg_config: ffmpeg-8.1.json} + - {os: ubuntu-24.04-riscv, python: "3.13", ffmpeg: "9.0.1", ffmpeg_config: ffmpeg-latest.json} + - {os: macos-14, python: "3.12", ffmpeg: "8.1.2", ffmpeg_config: ffmpeg-8.1.json} + - {os: macos-14, python: "3.14", ffmpeg: "9.0.1", ffmpeg_config: ffmpeg-latest.json} env: PYAV_PYTHON: python${{ matrix.config.python }} PYAV_LIBRARY: ffmpeg-${{ matrix.config.ffmpeg }} + # 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. + # unsafe-best-match is needed so uv still falls back to PyPI for + # packages/versions RISE doesn't happen to carry. + UV_INDEX: ${{ matrix.config.os == 'ubuntu-24.04-riscv' && 'https://pypi.riseproject.dev/simple/' || '' }} + UV_INDEX_STRATEGY: ${{ matrix.config.os == 'ubuntu-24.04-riscv' && 'unsafe-best-match' || 'first-index' }} + # pyav-ffmpeg's vendor packages bake prefix=/tmp/vendor into their .pc + # files (not relocatable), so they must be extracted there verbatim. + PKG_CONFIG_PATH: /tmp/vendor/lib/pkgconfig + LD_LIBRARY_PATH: /tmp/vendor/lib + DYLD_LIBRARY_PATH: /tmp/vendor/lib steps: - uses: actions/checkout@v7 @@ -64,33 +78,18 @@ jobs: python-version: ${{ matrix.config.python }} - name: OS Packages + if: runner.os == 'Linux' run: | - case ${{ matrix.config.os }} in - ubuntu-24.04) - sudo apt-get update - sudo apt-get install \ - autoconf \ - automake \ - build-essential \ - cmake \ - libtool \ - libx264-dev \ - nasm \ - pkg-config \ - zlib1g-dev - if [[ "${{ matrix.config.extras }}" ]]; then - sudo apt-get install doxygen - fi - ;; - macos-14) - brew install automake libtool opus x264 - ;; - esac - - - name: Pip and FFmpeg + sudo apt-get update + sudo apt-get install -y build-essential cmake pkg-config zlib1g-dev libxcb-shape0 + if [[ "${{ matrix.config.extras }}" ]]; then + sudo apt-get install -y doxygen + fi + + - name: FFmpeg run: | . scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }} - scripts/build-deps + python scripts/fetch-vendor.py --config-file scripts/${{ matrix.config.ffmpeg_config }} /tmp/vendor - name: Build run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb4b4c294..7189a0566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,8 @@ jobs: arch: arm64 - os: macos-15-intel arch: x86_64 + - os: ubuntu-24.04-riscv + arch: riscv64 - os: ubuntu-24.04-arm arch: aarch64 - os: ubuntu-24.04 @@ -61,7 +63,10 @@ jobs: CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor CIBW_BEFORE_BUILD_MACOS: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py --config-file scripts\ffmpeg-latest.json C:\cibw\vendor - CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig + # riscv64 wheels (e.g. numpy, for CIBW_TEST_REQUIRES) are often missing on + # PyPI; RISE mirrors prebuilt wheels for it. unsafe-best-match is needed so + # uv still falls back to PyPI for packages/versions RISE doesn't carry. + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig${{ matrix.arch == 'riscv64' && ' UV_INDEX=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match' || '' }} CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names CIBW_ENVIRONMENT_WINDOWS: INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib PYAV_SKIP_TESTS=unicode_filename CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel}