diff --git a/.github/workflows/reference_resources.yaml b/.github/workflows/reference_resources.yaml new file mode 100644 index 00000000..e0414d51 --- /dev/null +++ b/.github/workflows/reference_resources.yaml @@ -0,0 +1,52 @@ +name: Reference resource generation tests + +on: + workflow_dispatch: + pull_request: + paths: + - test/generate_reference_resources.sh + schedule: + - cron: '0 0 * * 0' # on sunday + +defaults: + run: + shell: bash -l -eo pipefail {0} + +jobs: + test-reference-resource-generation: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.9'] + ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] + steps: + - name: Setup conda env + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + miniconda-version: "latest" + activate-environment: test + python-version: ${{ matrix.python-version }} + + - name: Install ffmpeg + run: | + conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge + ffmpeg -version + + - name: Update pip + run: python -m pip install --upgrade pip + + - name: Instal generation dependencies + run: | + # Note that we're installing stable - this is for running a script where we're a normal PyTorch + # user, not for building TorhCodec. + python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu + python -m pip install numpy pillow + + - name: Check out repo + uses: actions/checkout@v3 + + - name: Run generation reference resources + run: | + test/generate_reference_resources.sh