From 2df6d266bd6fc993f540f230c4c0ffa7b04ee364 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 25 Apr 2020 13:50:35 +0300 Subject: [PATCH] Add a GitHub action to avoid breaking builds --- .github/actions/install_deps.sh | 23 +++++++++++++++++++++++ .github/workflows/buildability.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/actions/install_deps.sh create mode 100644 .github/workflows/buildability.yml diff --git a/.github/actions/install_deps.sh b/.github/actions/install_deps.sh new file mode 100644 index 00000000..1c9749ef --- /dev/null +++ b/.github/actions/install_deps.sh @@ -0,0 +1,23 @@ +case `echo $1 | cut -d '-' -f 1` in + ubuntu) + sudo apt-get -qq update + sudo apt-get install -yq bison libpng-dev pkg-config libsdl2-dev + ( + cd `mktemp -d` + curl -L https://github.com/rednex/rgbds/archive/v0.4.0.zip > rgbds.zip + unzip rgbds.zip + cd rgbds-* + make -sj + sudo make install + cd .. + rm -rf * + ) + ;; + macos) + brew install rgbds sdl2 + ;; + *) + echo "Unsupported OS" + exit 1 + ;; +esac \ No newline at end of file diff --git a/.github/workflows/buildability.yml b/.github/workflows/buildability.yml new file mode 100644 index 00000000..e5f4a30e --- /dev/null +++ b/.github/workflows/buildability.yml @@ -0,0 +1,28 @@ +name: "Bulidability" +on: push + +jobs: + buildability: + strategy: + matrix: + os: [ubuntu-latest, ubuntu-16.04, macos-latest] + cc: [gcc, clang] + include: + - os: macos-latest + cc: clang + extra_target: cocoa + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Install deps + shell: bash + run: | + ./.github/actions/install_deps.sh ${{ matrix.os }} + - name: Build + run: | + make sdl ${{ matrix.extra_target }} -j CONF=release CC=${{ matrix.cc }} + - name: Upload binaries + uses: actions/upload-artifact@v1 + with: + name: sameboy-canary-${{ matrix.os }}-${{ matrix.cc }} + path: build/bin \ No newline at end of file