Skip to content

Commit

Permalink
[ci] fixed vtest compare exit code on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Jul 17, 2023
1 parent 6d215f2 commit d4406fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_vtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion vtest/vtest-compare-pngs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ CURRENT_DIR="./current_pngs"
REFERENCE_DIR="./reference_pngs"
OUTPUT_DIR="./comparison"
GEN_GIF=1
CI_MODE=0

while [[ "$#" -gt 0 ]]; do
case $1 in
-c|--current-dir) CURRENT_DIR="$2"; shift ;;
-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
Expand Down Expand Up @@ -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

0 comments on commit d4406fb

Please sign in to comment.