Skip to content

Commit 110db88

Browse files
authored
Add Mac to FFmpeg build CI (#201)
1 parent 2b4f809 commit 110db88

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

.github/workflows/build_ffmpeg.yaml

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# This job does not include the uploading part.
88
# Upload needs to be done manually, and it should be done only once
9-
# par new major release of FFmepg.
9+
# per new major release of FFmepg.
1010
name: Build non-GPL FFmpeg from source
1111

1212
on:
@@ -20,26 +20,47 @@ defaults:
2020

2121
jobs:
2222
LGPL-Linux-x86_64:
23-
runs-on: ubuntu-latest
2423
strategy:
2524
fail-fast: false
2625
matrix:
2726
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
28-
steps:
29-
- name: Check out repo
30-
uses: actions/checkout@v3
31-
- name: Build FFmpeg
32-
run: |
33-
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
34-
export FFMPEG_ROOT="${PWD}/ffmpeg"
35-
36-
packaging/build_ffmpeg.sh
37-
38-
tar -czf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
39-
40-
mkdir -p artifact_dir
41-
mv ffmpeg.tar.gz artifact_dir/ffmpeg_"${FFMPEG_VERSION}".tar.gz
42-
- uses: actions/upload-artifact@v4
43-
with:
44-
name: "ffmpeg_${{ matrix.ffmpeg-version }}_linux_x86_64"
45-
path: artifact_dir
27+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
28+
with:
29+
job-name: Build
30+
upload-artifact: ffmpeg-lgpl
31+
repository: pytorch/torchcodec
32+
script: |
33+
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
34+
export FFMPEG_ROOT="${PWD}/ffmpeg"
35+
36+
packaging/build_ffmpeg.sh
37+
38+
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
39+
40+
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/linux_x86_64"
41+
mkdir -p "${artifact_dir}"
42+
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"
43+
44+
LGPL-macOS:
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
49+
runner: ["macos-m1-stable", "macos-12"]
50+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
51+
with:
52+
job-name: Build
53+
upload-artifact: ffmpeg-lgpl
54+
repository: pytorch/torchcodec
55+
runner: "${{ matrix.runner }}"
56+
script: |
57+
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
58+
export FFMPEG_ROOT="${PWD}/ffmpeg"
59+
60+
packaging/build_ffmpeg.sh
61+
62+
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
63+
64+
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/macos_$(uname -m)"
65+
mkdir -p "${artifact_dir}"
66+
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"

0 commit comments

Comments
 (0)