Skip to content

Use new way of specify the license #2720

Use new way of specify the license

Use new way of specify the license #2720

Workflow file for this run

name: CPP tests
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: unit-test${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l -eo pipefail {0}
jobs:
Cpp-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Setup conda env
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
# Using miniforge instead of miniconda ensures that the default
# conda channel is conda-forge instead of main/default. This ensures
# ABI consistency between dependencies:
# https://conda-forge.org/docs/user/transitioning_from_defaults/
miniforge-version: latest
activate-environment: test
python-version: '3.12'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install torch dependencies
run: |
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
- name: Install ffmpeg, pkg-config and pybind11
run: |
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" pkg-config pybind11 -c conda-forge
ffmpeg -version
- name: Build and run C++ tests
run: |
# Note: we're not setting BUILD_AGAINST_ALL_FFMPEG_FROM_S3 here, so
# we're building libtorchcodec against the installed FFmpeg version
# (from conda-forge) instead of building against our pre-built non-GPL
# FFmpeg libraries.
# The reason we need this is because the C++ tests decode x264 files.
# x264 support is not LGPL, os it is not supported by our
# pre-built non-GPL FFmpeg libraries. And if we were to build against
# those, this is also what the tests would be loading at run time,
# then failing when we try to decode x264.
# To remediate that, we build against the FFmpeg that we installed
# from conda-forge (which is able to decode x264), and that's also
# what gets loaded at run time.
# The Python tests are also decoding x264 files, and are built against
# our non-GPL FFmpeg. And yet they pass. This is because in Python
# we're able to distinguish between build-time (non-GPL FFmpeg) and
# run time (conda-forge FFmpeg).
build_tests_dir="${PWD}/build_tests"
mkdir $build_tests_dir
pushd $build_tests_dir
TORCH_PATH=$(python -c "import pathlib, torch; print(pathlib.Path(torch.__path__[0]))")
Torch_DIR="${TORCH_PATH}/share/cmake/Torch"
cmake .. -DTorch_DIR=$Torch_DIR -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build .
ctest --output-on-failure
popd
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy