diff options
Diffstat (limited to '.github')
| -rwxr-xr-x | .github/calcrom/webhook.sh | 11 | ||||
| -rw-r--r-- | .github/workflows/build.yml | 47 |
2 files changed, 58 insertions, 0 deletions
diff --git a/.github/calcrom/webhook.sh b/.github/calcrom/webhook.sh new file mode 100755 index 000000000..2a3015969 --- /dev/null +++ b/.github/calcrom/webhook.sh @@ -0,0 +1,11 @@ +#!/bin/bash -ex + +build_name=$1 +map_file=$build_name.map +if [ ! -f $map_file ]; then + echo "$map_file does not exist!" + exit 1 +fi + +output=$(perl $(dirname "$0")/calcrom.pl $build_name.map | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g') +curl -d "{\"username\": \"$CALCROM_DISCORD_WEBHOOK_USERNAME\", \"avatar_url\": \"$CALCROM_DISCORD_WEBHOOK_AVATAR_URL\", \"content\":\"\`\`\`$build_name progress:\\n$output\`\`\`\"}" -H "Content-Type: application/json" -X POST "$CALCROM_DISCORD_WEBHOOK_URL" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..f8ad97065 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + +jobs: + build: + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Install binutils + run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi + # build-essential, git, and libpng-dev are already installed + # gcc-arm-none-eabi is only needed for the modern build + # as an alternative to dkP + + - name: Install agbcc + run: | + git clone https://github.com/pret/agbcc.git + cd agbcc + ./build.sh + ./install.sh ../ + + - name: Compare FireRed + run: | + make -j${nproc} compare_firered + make -j${nproc} compare_firered_rev1 + + - name: Compare LeafGreen + run: | + make -j${nproc} compare_leafgreen + make -j${nproc} compare_leafgreen_rev1 + + - name: Modern + run: make -j${nproc} modern + + - name: Webhook + if: ${{ github.event_name == 'push' }} + env: + CALCROM_DISCORD_WEBHOOK_USERNAME: OK + CALCROM_DISCORD_WEBHOOK_AVATAR_URL: https://i.imgur.com/38BQHdd.png + CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }} + run: sh .github/calcrom/webhook.sh pokefirered |
