[ci] fixed vtest compare exit code on CI

This commit is contained in:
Igor Korsukov 2023-07-15 23:10:06 +03:00
parent 6d215f2893
commit d4406fb44f
2 changed files with 8 additions and 2 deletions

View File

@ -145,7 +145,7 @@ jobs:
- name: Compare PNGs
run: |
echo "VTEST_DIFF_FOUND=false" >> $GITHUB_ENV
./vtest/vtest-compare-pngs.sh
./vtest/vtest-compare-pngs.sh --ci 1
- name: Upload comparison
if: env.VTEST_DIFF_FOUND == 'true'
uses: actions/upload-artifact@v3

View File

@ -25,6 +25,7 @@ CURRENT_DIR="./current_pngs"
REFERENCE_DIR="./reference_pngs"
OUTPUT_DIR="./comparison"
GEN_GIF=1
CI_MODE=0
while [[ "$#" -gt 0 ]]; do
case $1 in
@ -32,6 +33,7 @@ while [[ "$#" -gt 0 ]]; do
-r|--reference-dir) REFERENCE_DIR="$2"; shift ;;
-o|--output-dir) OUTPUT_DIR="$2"; shift ;;
-g|--gen-gif) GEN_GIF=$2; shift ;;
--ci) CI_MODE=$2; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
@ -117,5 +119,9 @@ if [ "$VTEST_DIFF_FOUND" == "true" ]; then
echo " </body>" >> $HTML
echo "</html>" >> $HTML
exit 1
if [ $CI_MODE -eq 1 ]; then
exit 0
else
exit 1
fi
fi