ci(ref_imgs): make the CI fail if there not all ref. images are added (#7086)

This commit is contained in:
Gabor Kiss-Vamosi
2024-10-18 05:47:44 +02:00
committed by GitHub
parent 8ab11dcf60
commit e332a0db52
69 changed files with 31 additions and 6 deletions
+31 -6
View File
@@ -91,9 +91,34 @@ jobs:
path: |
tests/ref_imgs*/**/*_err.png
test_screenshot_error.h
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# if: github.event_name == 'push' && github.repository == 'lvgl/lvgl'
# with:
# fail_ci_if_error: true
# verbose: true
- id: check_untracked_ref_imgs
name: Check for new files and upload them as artifacts if found
run: |
NEW_REF_IMGS=$(git status --porcelain -- tests/ref_imgs* | grep '^??' | awk '{print $2}')
if [ -n "$NEW_REF_IMGS" ]; then
echo "New files were added during the build process."
echo "Uploading untracked ref. images as artifacts..."
for file in $NEW_REF_IMGS; do
echo "Found new file: $file"
done
zip -r untracked_ref_imgs.zip $NEW_REF_IMGS
echo "::set-output name=new_ref_imgs_found::true"
else
echo "No new files were found."
echo "::set-output name=new_ref_imgs_found::false"
fi
- name: Upload untracked reference images
if: steps.check_untracked_ref_imgs.outputs.new_ref_imgs_found == 'true'
uses: actions/upload-artifact@v3
with:
name: Untracked Reference Images
path: untracked_ref_imgs.zip
- name: Fail the build if new files were found
if: steps.check_untracked_ref_imgs.outputs.new_ref_imgs_found == 'true'
run: |
echo "Failing the build due to newly generated reference images."
exit 1