diff --git a/.travis/calcrom/calcrom.pl b/.github/calcrom/calcrom.pl similarity index 100% rename from .travis/calcrom/calcrom.pl rename to .github/calcrom/calcrom.pl diff --git a/.travis/calcrom/webhook.sh b/.github/calcrom/webhook.sh similarity index 76% rename from .travis/calcrom/webhook.sh rename to .github/calcrom/webhook.sh index 86da74c873..5dd65a75f2 100755 --- a/.travis/calcrom/webhook.sh +++ b/.github/calcrom/webhook.sh @@ -1,7 +1,7 @@ #!/bin/bash -ex # Only run this script if it's the master branch build. -if [[ "$TRAVIS_BRANCH" != "master" || "$TRAVIS_PULL_REQUEST" != "false" ]]; then +if [[ "$GITHUB_REF" != "refs/heads/master" || "$GITHUB_EVENT_NAME" != "false" ]]; then exit 0 fi @@ -13,4 +13,4 @@ if [ ! -f $map_file ]; then 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 +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 0000000000..220b14da33 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + +env: + CALCROM_DISCORD_WEBHOOK_USERNAME: ${{ secrets.CALCROM_DISCORD_WEBHOOK_USERNAME }} + CALCROM_DISCORD_WEBHOOK_AVATAR_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_AVATAR_URL }} + CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }} + +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 + run: make -j${nproc} compare + + - name: Modern + run: make -j${nproc} modern + + - name: Webhook + run: sh .github/calcrom/webhook.sh pokeemerald diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d39be503f..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: generic -dist: bionic -sudo: false -env: - global: - - DEVKITPRO=$HOME - - DEVKITARM=$DEVKITPRO/devkitARM -addons: - apt: - packages: - - gcc-multilib - - linux-libc-dev -cache: - apt: true -install: - - pushd $HOME - - travis_retry wget https://github.com/devkitPro/buildscripts/releases/download/devkitARM_r52/devkitARM_r52-linux.tar.xz - - tar xJf devkitARM*.tar.xz - - travis_retry wget https://github.com/devkitPro/devkitarm-rules/releases/download/v1.0.0/devkitarm-rules-1.0.0.tar.xz - - tar xJf devkitarm-rules-*.tar.xz -C $DEVKITARM - - travis_retry git clone https://github.com/pret/agbcc.git - - cd agbcc && ./build.sh && ./install.sh $TRAVIS_BUILD_DIR - - popd -matrix: - include: - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: _="Build" - script: - - make -j2 tools CXX=g++-7 - - make -j2 compare - - make -j2 modern -after_success: - - .travis/calcrom/webhook.sh pokeemerald