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 : |