Skip to content

Commit bf016d7

Browse files
committed
Add a check for videos format in CI
1 parent d806d88 commit bf016d7

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ jobs:
5757
- name: Type check simple example
5858
run: cd examples/simple && yarn type-check
5959

60+
doc-videos-format-check:
61+
runs-on: ubuntu-latest
62+
if: github.ref_type != 'tag'
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
- name: Videos format check
67+
run: make check-documentation-videos-format
68+
6069
doc-check:
6170
runs-on: ubuntu-latest
6271
if: github.ref_type != 'tag'

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@ build-storybook: ## Build the storybook
175175

176176
update-sandbox: ## Push the local version of the simple example to the sandbox repository
177177
./scripts/update-sandbox.sh
178+
179+
check-documentation-videos-format: ## Check the documentation format
180+
./scripts/check-documentation-videos-format.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
for file in ./docs/img/*; do
2+
codec=$(mediainfo --Inform="Video;%CodecID%" "$file")
3+
if [ "$codec" = "hvc1" ]; then
4+
# Construct the output file name
5+
output_file="${file%.*}_avc1.${file##*.}"
6+
# Convert the file to avc1 (H.264)
7+
ffmpeg -i "$file" -c:v libx264 -c:a copy "$output_file"
8+
rm $file
9+
mv $output_file $file
10+
echo "Fixed codec for $file"
11+
fi
12+
done

0 commit comments

Comments
 (0)