Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/build_ffmpeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
pull_request:
paths:
- packaging/build_ffmpeg.sh
- packaging/build_ffmpeg_arm64.bat
- packaging/build_ffmpeg.bat
- .github/workflows/build_ffmpeg.yaml # self reference
schedule:
- cron: '0 0 * * 0' # on sunday
Expand Down Expand Up @@ -119,3 +121,41 @@ jobs:
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/windows_$(uname -m)"
mkdir -p "${artifact_dir}"
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"

# Native Windows ARM64 counterpart of LGPL-Windows. Runs on GitHub's
# standard `windows-11-arm` hosted runner (GA for public repos since
# 2025-08-07) instead of pytorch/test-infra's windows_job.yml wrapper,
# since that reusable workflow targets test-infra's own x86_64 runner
# fleet. This job only produces a build artifact; per this workflow's
# header comment, uploading it to the S3 bucket consumed by
# BUILD_AGAINST_ALL_FFMPEG_FROM_S3 is a separate, manual, maintainer-only
# step that must be done once to unblock windows_wheel.yaml's arm64 build.
LGPL-Windows-arm64:
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0", "9.0"]
runs-on: windows-11-arm
defaults:
run:
shell: bash -l -eo pipefail {0}
steps:
- name: Check out repo
uses: actions/checkout@v6

- name: Build FFmpeg (LGPL, decode/encode symbols only) and package artifact
run: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"

packaging/build_ffmpeg_arm64.bat

tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/bin

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ffmpeg-lgpl-windows_arm64-${{ matrix.ffmpeg-version }}
path: ffmpeg.tar.gz
if-no-files-found: error
retention-days: 14
37 changes: 37 additions & 0 deletions .github/workflows/build_libavif.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
paths:
- packaging/build_libavif.sh
- packaging/build_libavif.bat
- packaging/build_libavif_arm64.bat
- .github/workflows/build_libavif.yaml
schedule:
- cron: '0 0 * * 0' # on sunday
Expand Down Expand Up @@ -121,3 +122,39 @@ jobs:
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/windows_$(uname -m)"
mkdir -p "${artifact_dir}"
mv libavif.tar.gz "${artifact_dir}/${LIBAVIF_VERSION}.tar.gz"

# Native Windows ARM64 counterpart of libavif-Windows. See the equivalent
# LGPL-Windows-arm64 job in build_ffmpeg.yaml for why this uses GitHub's
# standard `windows-11-arm` hosted runner directly instead of
# pytorch/test-infra's windows_job.yml. Same manual-S3-upload caveat
# applies here too.
libavif-Windows-arm64:
strategy:
fail-fast: false
matrix:
libavif-version: ["1.4.2"]
runs-on: windows-11-arm
defaults:
run:
shell: bash -l -eo pipefail {0}
steps:
- name: Check out repo
uses: actions/checkout@v6

- name: Build libavif (decode-only) and package artifact
run: |
export LIBAVIF_VERSION="${{ matrix.libavif-version }}"
export LIBAVIF_ROOT="${PWD}/libavif"

packaging/build_libavif_arm64.bat

# Include lib (import lib) and bin (DLL) so the consumer has both.
tar -cf libavif.tar.gz libavif/include libavif/lib libavif/bin libavif/licenses

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: libavif-windows_arm64-${{ matrix.libavif-version }}
path: libavif.tar.gz
if-no-files-found: error
retention-days: 14
136 changes: 136 additions & 0 deletions .github/workflows/windows_arm64_wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Windows ARM64 Wheel

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/windows_arm64_wheel.yaml
- packaging/build_ffmpeg.sh
- packaging/build_ffmpeg_arm64.bat
- packaging/build_libavif.sh
- packaging/build_libavif_arm64.bat
- packaging/vc_env_helper_arm64.bat
- packaging/install_build_dependencies.sh
- packaging/pre_build_script.sh
- packaging/post_build_script.sh
- packaging/install_pytorch.sh
- packaging/install_torchcodec_wheel.sh
- packaging/install_test_dependencies.sh
- packaging/remove_src.sh
- packaging/assert_ffmpeg_version.py
- test/smoke_test.py
- pyproject.toml
- CMakeLists.txt
- src/torchcodec/_core/**
push:
branches:
- winarm64-hackathon
paths:
- .github/workflows/windows_arm64_wheel.yaml
- packaging/build_ffmpeg.sh
- packaging/build_ffmpeg_arm64.bat
- packaging/build_libavif.sh
- packaging/build_libavif_arm64.bat
- packaging/vc_env_helper_arm64.bat
- packaging/install_build_dependencies.sh
- packaging/pre_build_script.sh
- packaging/post_build_script.sh
- packaging/install_pytorch.sh
- packaging/install_torchcodec_wheel.sh
- packaging/install_test_dependencies.sh
- packaging/remove_src.sh
- packaging/assert_ffmpeg_version.py
- test/smoke_test.py
- pyproject.toml
- CMakeLists.txt
- src/torchcodec/_core/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-and-test:
runs-on: windows-11-arm
defaults:
run:
shell: bash -l -eo pipefail {0}
env:
FFMPEG_VERSION: "9.0"
LIBAVIF_VERSION: "1.4.2"
TORCHCODEC_BUILD_HEIC: "0"
FAIL_WITHOUT_IMAGE_CODECS: "1"
FAIL_WITHOUT_HEIC: "0"
steps:
- name: Check out repo
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install PyTorch
run: bash packaging/install_pytorch.sh cpu "torch torchvision"

- name: Install build dependencies
run: |
python -m pip install pybind11 "scikit-build-core>=0.10" ninja

- name: Build FFmpeg
run: |
export FFMPEG_ROOT="${PWD}/ffmpeg"
packaging/build_ffmpeg_arm64.bat

- name: Build libavif
run: |
export LIBAVIF_ROOT="${PWD}/libavif"
packaging/build_libavif_arm64.bat

- name: Build wheel
shell: cmd
run: |
call packaging\vc_env_helper_arm64.bat ^
set BUILD_AGAINST_ALL_FFMPEG_FROM_S3= ^&^& ^
set BUILD_AGAINST_ALL_FFMPEG_FROM_LOCAL=1 ^&^& ^
set FFMPEG_ROOT=%CD%\ffmpeg ^&^& ^
set LIBAVIF_ROOT=%CD%\libavif ^&^& ^
set TORCHCODEC_BUILD_HEIC=0 ^&^& ^
python -m build --wheel -vvv --no-isolation

- name: Repair and inspect wheel
run: |
bash packaging/post_build_script.sh
ls -R
ls -R dist || true
ls -R wheelhouse || true

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: torchcodec-windows-arm64-py311
path: |
dist/*.whl
wheelhouse/*.whl
if-no-files-found: error
retention-days: 14

- name: Remove src/ folder
run: bash packaging/remove_src.sh

- name: Install torchcodec from the wheel
run: bash packaging/install_torchcodec_wheel.sh

- name: Install test dependencies
run: bash packaging/install_test_dependencies.sh false

- name: Run ARM64 smoke test
run: |
python packaging/assert_ffmpeg_version.py 9
FAIL_WITHOUT_IMAGE_CODECS=1 FAIL_WITHOUT_HEIC=0 pytest --override-ini="addopts=-v" test/smoke_test.py --tb=short
Loading