-
-
Notifications
You must be signed in to change notification settings - Fork 17
Rework FFmpeg installation in unit test workflow #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
66d841f
introduce os specific instructions to install FFmpeg in GitHub workflow
rob93c d45203e
add checks on installed FFmpeg and FFprobe versions
rob93c 912a470
extract FFmpeg setup to a standalone action
rob93c e328e7d
update FFmpeg version used in dockerfile
rob93c 91e33a9
update license year
rob93c 5fda36b
minor formatting fixes
rob93c 39dbf05
switch mac runner to arm architecture
rob93c 69b4805
fix ffprobe installation on mac arm
rob93c 413f9b5
add cleanup instructions for mac and windows
rob93c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Setup FFmpeg and FFprobe | ||
| description: Install FFmpeg and FFprobe across Linux, macOS, and Windows | ||
| inputs: | ||
| ffmpeg-version: | ||
| description: FFmpeg version to install | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install FFmpeg and FFprobe | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| FF_VERSION="${{ inputs.ffmpeg-version }}" | ||
| INSTALL_DIR="$HOME/ffmpeg" | ||
| mkdir -p "$INSTALL_DIR" | ||
|
|
||
| echo "Installing FFmpeg and FFprobe $FF_VERSION on ${{ runner.os }}" | ||
|
|
||
| if [[ "${{ runner.os }}" == "Linux" ]]; then | ||
| docker pull mwader/static-ffmpeg:$FF_VERSION | ||
| CID=$(docker create mwader/static-ffmpeg:$FF_VERSION) | ||
| docker cp "$CID:/ffmpeg" "$INSTALL_DIR/ffmpeg" | ||
| docker cp "$CID:/ffprobe" "$INSTALL_DIR/ffprobe" | ||
| docker rm "$CID" | ||
| chmod +x "$INSTALL_DIR/"* | ||
|
|
||
| elif [[ "${{ runner.os }}" == "macOS" ]]; then | ||
| FF_VERSION=$(echo "$FF_VERSION" | awk -F. '{print $1 $2}') | ||
| curl -L "https://www.osxexperts.net/ffmpeg${FF_VERSION}arm.zip" -o ffmpeg.zip | ||
| unzip -q ffmpeg.zip | ||
| mv ffmpeg "$INSTALL_DIR/ffmpeg" | ||
| curl -L "https://www.osxexperts.net/ffprobe${FF_VERSION}arm.zip" -o ffprobe.zip | ||
| unzip -q ffprobe.zip | ||
| mv ffprobe "$INSTALL_DIR/ffprobe" | ||
| chmod +x "$INSTALL_DIR/"* | ||
| rm -f ffmpeg.zip ffprobe.zip | ||
|
|
||
| elif [[ "${{ runner.os }}" == "Windows" ]]; then | ||
| curl -L "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-$FF_VERSION-essentials_build.zip" -o ffmpeg.zip | ||
| unzip -q ffmpeg.zip | ||
| find . -type f \( -name ffmpeg.exe -o -name ffprobe.exe \) -exec mv {} "$INSTALL_DIR/" \; | ||
| rm -f ffmpeg.zip | ||
| fi | ||
|
|
||
| echo "$INSTALL_DIR" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Verify FFmpeg and FFprobe installations | ||
| shell: bash | ||
| run: | | ||
| ffmpeg -version | ||
| ffprobe -version | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.