Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pytorch-labs/torchcodec into find_i…
Browse files Browse the repository at this point in the history
…nstalled_ffmpeg_version
  • Loading branch information
NicolasHug committed Jun 17, 2024
2 parents 25a2e22 + 3816bc1 commit 58437aa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Test
name: CPP tests

on:
push:
Expand All @@ -14,49 +14,7 @@ defaults:
shell: bash -l -eo pipefail {0}

jobs:
python:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
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@v2
with:
auto-update-conda: true
miniconda-version: "latest"
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
- name: Build and install torchcodec
run: |
.github/scripts/assert_ffmpeg_not_installed.sh
# TODO: should we pass -DCMAKE_BUILD_TYPE=Debug here? That's what we
# do for the C++ tests.
BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 python -m pip install -e ".[dev]" --no-build-isolation -vvv
# list the built so files, for debugging.
find src | grep ".so"
- name: Install ffmpeg, post build
run: |
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
ffmpeg -version
- name: Smoke test
run: |
python test/decoders/manual_smoke_test.py
# TODO: diff the output frame with its expeceted value
- name: Run Python tests
run: |
pytest test
Cpp:
Cpp-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

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:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
steps:
- name: Check out repo
uses: actions/checkout@v3
- 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: Update pip
run: python -m pip install --upgrade pip
- name: Install pre-commit
run: |
python -m pip install pre-commit
- name: Run pre-commit checks
run: |
pre-commit run --all-files
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ repos:
- id: check-added-large-files
args: ['--maxkb=1000']

# - repo: https://github.com/omnilib/ufmt
# rev: v2.3.0
# hooks:
# - id: ufmt
# additional_dependencies:
# - black == 22.12.0
# - usort == 1.0.5
- repo: https://github.com/omnilib/ufmt
rev: v2.6.0
hooks:
- id: ufmt
additional_dependencies:
- black == 24.4.2
- usort == 1.0.5

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
Expand Down

0 comments on commit 58437aa

Please sign in to comment.