diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-14 21:32:54 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-14 21:32:54 -0400 |
commit | 2fc95196e9774ed00ff50d730a5d50ca89534d1a (patch) | |
tree | 56337db5342d1c3e2edfc91a83c310f5d34b222d | |
parent | 51a580a83f971fd5685824c86cfe186a2939a2cd (diff) |
Set up Travis CI
-rw-r--r-- | .travis.yml | 28 | ||||
-rw-r--r-- | .travis/webhook.sh | 15 |
2 files changed, 43 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..097eac10 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: c +os: + - linux + - osx +install: + - |- + ( cd + git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds + sudo make -C rgbds install + rm -rf rgbds + ) +before_script: + - |- + function check_status() { + if ! git diff-index --quiet --ignore-submodules=all HEAD --; then + echo 'Uncommitted changes detected:'; + git diff-index HEAD --; + return 1; + fi; + } +script: + - make -j2 compare + - check_status +after_success: + - |- + if [ "$TRAVIS_BRANCH" = master -a "$TRAVIS_PULL_REQUEST" = false -a "$TRAVIS_OS_NAME" = linux ]; then + ./.travis/webhook.sh + fi diff --git a/.travis/webhook.sh b/.travis/webhook.sh new file mode 100644 index 00000000..49a9a471 --- /dev/null +++ b/.travis/webhook.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +root="$(readlink -e "$(dirname "$0")/..")" + +# Report unnamed symbols +content="$("$root/tools/unnamed.py" -r "$root" "$root/pokegold.sym" | head)" + +curl -H 'Content-Type: application/json' -X POST "$POKEGOLD_DISCORD_WEBHOOK_URL" -d@- << EOF +{ + "username": "$POKEGOLD_DISCORD_WEBHOOK_USERNAME", + "avatar_url": "$POKEGOLD_DISCORD_WEBHOOK_AVATAR_URL", + "content": "\`\`\`$(echo "$content" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')\`\`\`" +} +EOF |