Skip to content

Commit

Permalink
ci: add test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicle committed Dec 30, 2024
1 parent c870f88 commit 36718bc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ tcardgen
*.png
*.ttf
!example/*.png
test/*.png
27 changes: 27 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -xeo pipefail

FNAME=KintoSans.zip
VERSION=${VERSION:-v1.0.1}

# Download Fonts to `font` directory
if [ ! -f font/KintoSans-Regular.ttf ]; then
mkdir -p font
wget https://github.com/ookamiinc/kinto/releases/download/${VERSION}/${FNAME}
unzip -j $FNAME "*.ttf" -d font
rm $FNAME
fi

# Generate an image and check diff
[ -d test ] && rm -r test
mkdir -p test
for name in "blog-post" "blog-post2"; do
echo "Test $name"
go run main.go \
-f font \
-o test/ \
-t example/template.png \
example/$name.md
diff test/$name.png example/$name.png
done

0 comments on commit 36718bc

Please sign in to comment.