Skip to content

Commit

Permalink
ci: added Github Actions build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Nov 6, 2020
1 parent 2e951f0 commit 6b8e574
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 8 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build

on: [push]

jobs:
linux_clang6:
name: "Linux Clang6"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: ./.travis/linux/run-container.sh 6
- uses: actions/upload-artifact@v2
with:
path: upload/*

linux_clang8:
name: "Linux Clang8"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: ./.travis/linux/run-container.sh 8
- uses: actions/upload-artifact@v2
with:
path: upload/*

android:
name: "Android"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: ./.travis/android/run-container.sh
- uses: actions/upload-artifact@v2
with:
path: upload/*

macos:
name: "macOS"
runs-on: macOS-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: ./.travis/macos/install-dependencies.sh
- run: ./.travis/macos/build.sh
- uses: actions/upload-artifact@v2
with:
path: upload/*

# TODO: Add Windows
5 changes: 1 addition & 4 deletions .travis/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

cd /home/build

export BUILD_MODE=release
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
export BUILD_MODE=debug
fi
export BUILD_MODE=${BUILD_MODE:-debug}

export OS=android
export DATE=$(date +%Y%m%d)
Expand Down
10 changes: 8 additions & 2 deletions .travis/android/run-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@
# Run in Travis to launch container

# Setup signing
export BUILD_MODE="debug"
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_7333c7dd5b15_key -iv $encrypted_7333c7dd5b15_iv -in android/avocado.keystore.enc -out android/avocado.keystore -d
export BUILD_MODE="release"
fi

if [ "$GITHUB_ACTIONS" = "true" ]; then
export BUILD_MODE="debug"
fi

mkdir -p "$HOME/.ccache"

docker run \
-e CI=$CI \
-e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST \
-e BUILD_MODE=$BUILD_MODE \
-e keystore_password="$keystore_password" \
-v $(pwd):/home/build \
-v "$HOME/.ccache":/root/.ccache \
-e keystore_password="$keystore_password" \
avocadoemu/android \
/bin/bash -ex /home/build/.travis/android/build.sh
4 changes: 2 additions & 2 deletions .travis/macos/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ mv premake5 /usr/local/bin/
rm premake-$PREMAKE_VERSION-macosx.tar.gz

# Download SDL2 and ccache
brew update
brew install sdl2 ccache
brew update > /dev/null
brew install sdl2 ccache

0 comments on commit 6b8e574

Please sign in to comment.