add fixed ffmpeg version for CI #278
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: Test Package | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: | |
| - '**/*.md' | |
| pull_request: | |
| branches: [ master ] | |
| env: | |
| FFMPEG_VERSION: "7.1" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache ffmpeg download | |
| uses: actions/cache@v3 | |
| id: cache-ffmpeg | |
| with: | |
| path: /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz | |
| key: ${{ runner.os }}-ffmpeg | |
| - name: Download ffmpeg if not cached | |
| if: steps.cache-ffmpeg.outputs.cache-hit != 'true' | |
| run: | | |
| echo "Downloading ffmpeg ${FFMPEG_VERSION}" | |
| wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -P /opt/ffmpeg | |
| - name: Extract and install ffmpeg | |
| run: | | |
| echo "Extracting ffmpeg ${FFMPEG_VERSION}" | |
| sudo mkdir -p /opt/ffmpeg/extracted | |
| sudo tar --strip-components 1 -xf /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -C /opt/ffmpeg/extracted | |
| echo "Installing ffmpeg ${FFMPEG_VERSION}" | |
| sudo cp /opt/ffmpeg/extracted/bin/ffmpeg /usr/bin/ffmpeg | |
| sudo cp /opt/ffmpeg/extracted/bin/ffprobe /usr/bin/ffprobe | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements.dev.txt | |
| pip install . | |
| - name: Type check with mypy | |
| run: | | |
| mypy ffmpeg_normalize | |
| - name: Test with pytest | |
| run: | | |
| pytest |