Skip to content

Commit 3ff4df4

Browse files
authored
Merge pull request #10441 from marmelab/ci-videos-format-check
Add a check for videos format in CI
2 parents d806d88 + 3727b59 commit 3ff4df4

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
echo "Invalid codec for $file"
7+
echo "Convert it to avc1 with:"
8+
echo "ffmpeg -i $file -c:v libx264 -c:a copy ${output_file}"
9+
echo "rm $file"
10+
echo "mv $output_file $file"
11+
exit 1;
12+
fi
13+
done

0 commit comments

Comments
 (0)