Skip to content

Commit

Permalink
Merge pull request #10441 from marmelab/ci-videos-format-check
Browse files Browse the repository at this point in the history
Add a check for videos format in CI
  • Loading branch information
slax57 authored Jan 10, 2025
2 parents d806d88 + 3727b59 commit 3ff4df4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ jobs:
- name: Type check simple example
run: cd examples/simple && yarn type-check

doc-videos-format-check:
runs-on: ubuntu-latest
if: github.ref_type != 'tag'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Videos format check
run: make check-documentation-videos-format

doc-check:
runs-on: ubuntu-latest
if: github.ref_type != 'tag'
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,6 @@ build-storybook: ## Build the storybook

update-sandbox: ## Push the local version of the simple example to the sandbox repository
./scripts/update-sandbox.sh

check-documentation-videos-format: ## Check the documentation format
./scripts/check-documentation-videos-format.sh
13 changes: 13 additions & 0 deletions scripts/check-documentation-videos-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
for file in ./docs/img/**; do
codec=$(mediainfo --Inform="Video;%CodecID%" "$file")
if [ "$codec" = "hvc1" ]; then
# Construct the output file name
output_file="${file%.*}_avc1.${file##*.}"
echo "Invalid codec for $file"
echo "Convert it to avc1 with:"
echo "ffmpeg -i $file -c:v libx264 -c:a copy ${output_file}"
echo "rm $file"
echo "mv $output_file $file"
exit 1;
fi
done

0 comments on commit 3ff4df4

Please sign in to comment.