Add a GitHub action to avoid breaking builds

This commit is contained in:
Lior Halphon 2020-04-25 13:50:35 +03:00
parent ddad913e06
commit 2df6d266bd
2 changed files with 51 additions and 0 deletions

23
.github/actions/install_deps.sh vendored Normal file
View File

@ -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

28
.github/workflows/buildability.yml vendored Normal file
View File

@ -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