diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-06-19 22:27:15 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-06-19 22:27:15 -0400 |
commit | a5c0da9bbebb1b5703778d83d147e262055cd46c (patch) | |
tree | 1653f7c342beece4bf59022cbbbe45f6a0923682 | |
parent | 0406c711893532514c843aeae262153d36be0ad5 (diff) |
Switch from Travis CI to GitHub Actions
-rwxr-xr-x | .github/webhook.sh | 13 | ||||
-rw-r--r-- | .github/workflows/main.yml | 45 | ||||
-rw-r--r-- | .travis.yml | 32 | ||||
-rwxr-xr-x | .travis/webhook.sh | 15 | ||||
-rw-r--r-- | README.md | 6 |
5 files changed, 61 insertions, 50 deletions
diff --git a/.github/webhook.sh b/.github/webhook.sh new file mode 100755 index 00000000..ce454a49 --- /dev/null +++ b/.github/webhook.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +# Report unnamed symbols +content="$(tools/unnamed.py -r . pokered.sym | head)" + +curl -H 'Content-Type: application/json' -X POST "$DISCORD_WEBHOOK_URL" -d@- << EOF +{ + "username": "OK", + "avatar_url": "https://i.imgur.com/38BQHdd.png", + "content": "\`\`\`$(echo "$content" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')\`\`\`" +} +EOF diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..a3fd4456 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Checkout rgbds + uses: actions/checkout@master + with: + path: rgbds + ref: v0.5.1 + repository: gbdev/rgbds + + - name: Install rgbds + working-directory: rgbds + run: | + sudo make install + + - name: Remove rgbds + run: | + rm -rf rgbds + + - name: Compare + run: | + make DEBUG=1 -j$(nproc) compare + if ! git diff-index --quiet HEAD --; then + echo 'Uncommitted changes detected:' + git diff-index HEAD -- + return 1 + fi + + - name: Discord webhook + if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }} + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + run: | + .github/webhook.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ff72754..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: c -os: - - linux - - osx -install: - - |- - ( cd - if [ "$TRAVIS_OS_NAME" = osx ]; then - HOMEBREW_NO_AUTO_UPDATE=1 brew install bison - export PATH="/usr/local/opt/bison/bin:$PATH" - fi - git clone -b v0.5.1 --depth=1 https://github.com/gbdev/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 DEBUG=1 -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 deleted file mode 100755 index e50f3c29..00000000 --- a/.travis/webhook.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -e - -root="$(readlink -e "$(dirname "$0")/..")" - -# Report unnamed symbols -content="$("$root/tools/unnamed.py" -r "$root" "$root/pokered.sym" | head)" - -curl -H 'Content-Type: application/json' -X POST "$POKERED_DISCORD_WEBHOOK_URL" -d@- << EOF -{ - "username": "$POKERED_DISCORD_WEBHOOK_USERNAME", - "avatar_url": "$POKERED_DISCORD_WEBHOOK_AVATAR_URL", - "content": "\`\`\`$(echo "$content" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')\`\`\`" -} -EOF @@ -1,4 +1,4 @@ -# Pokémon Red and Blue [![Build Status][travis-badge]][travis] +# Pokémon Red and Blue [![Build Status][ci-badge]][ci] This is a disassembly of Pokémon Red and Blue. @@ -37,5 +37,5 @@ Other disassembly projects: [pokeemerald]: https://github.com/pret/pokeemerald [discord]: https://discord.gg/d5dubZ3 [irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret -[travis]: https://travis-ci.org/pret/pokered -[travis-badge]: https://travis-ci.org/pret/pokered.svg?branch=master +[ci]: https://github.com/pret/pokered/actions +[ci-badge]: https://github.com/pret/pokered/actions/workflows/main.yml/badge.svg |