Skip to content

Commit

Permalink
Add a check for videos format in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jan 10, 2025
1 parent d806d88 commit bf016d7
Show file tree
Hide file tree
Showing 3 changed files with 24 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
12 changes: 12 additions & 0 deletions scripts/check-documentation-videos-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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##*.}"
# Convert the file to avc1 (H.264)
ffmpeg -i "$file" -c:v libx264 -c:a copy "$output_file"
rm $file
mv $output_file $file
echo "Fixed codec for $file"
fi
done

0 comments on commit bf016d7

Please sign in to comment.