mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-31 16:27:03 +08:00
ci(ref_imgs): make the CI fail if there not all ref. images are added (#7086)
This commit is contained in:
committed by
GitHub
parent
8ab11dcf60
commit
e332a0db52
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user