From aeedbbdb06ee95149e8f6d8167af6dc7b70c5aa3 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Thu, 7 Apr 2022 21:28:18 +0200 Subject: [PATCH] improved tiles verification (*) - Export the tiles as an artifact before verifying. - Only empty.png is verified via checksum. - Verify that all tiles are image/png files. - Verify that all tiles are different from another. --- .github/workflows/build-and-test.yaml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 951eaa2..74b255b 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -67,19 +67,32 @@ jobs: curl http://localhost/tile/1/1/1.png --fail -o 111.png curl http://localhost/tile/18/138474/85459.png --fail -o empty.png curl http://localhost/tile/18/135536/89345.png --fail -o example.png + - + name: Upload tiles + uses: actions/upload-artifact@v3 + with: + name: tiles + path: '*.png' - name: Verify tiles run : | sha1sum *.png sha1sum --check <&2 echo "ERROR: example.png is empty" && exit 1 ) + tiles=(`ls *.png`) + for ((i=0; i<${#tiles[@]}; i++)) ; do + if [ `file --brief --mime-type "${tiles[$i]}"` != 'image/png' ] ; then + >&2 echo "ERROR: ${tiles[$i]} is not a image/png file" + exit 1 + fi + for ((j=i+1; j<${#tiles[@]}; j++)) ; do + if ( diff "${tiles[$i]}" "${tiles[$j]}" ) ; then + >&2 echo "ERROR: ${tiles[$i]} is identical to ${tiles[$j]}" + exit 2 + fi + done + done - name: Cleanup run : |