CI: setup android sdk, too #114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: [push, pull_request] | |
| jobs: | |
| mac: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| run: | | |
| brew search box2d | |
| brew versions box2d | |
| cd $(brew --prefix) | |
| #git checkout 6b8d25f Library/Formula/box2d.rb | |
| brew install lua box2d sdl2 sdl2_image sdl2_mixer sdl2_net sqlite zlib yajl upx | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. -GXcode -DTOOLS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd) -DCAVEPACKER=OFF -DUNITTESTS=OFF | |
| xcodebuild build -target install -project caveproductions.xcodeproj CODE_SIGNING_REQUIRED=NO -configuration Release | |
| ../contrib/scripts/create_dmg.sh caveexpress dev $(pwd)/.. $(pwd) | |
| - name: Upload the caveexpress artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: caveexpress | |
| path: "build/caveexpress dev.dmg" | |
| linux: | |
| runs-on: ubuntu-22.04 | |
| container: debian:experimental | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| run: | | |
| apt-get update | |
| apt-get install -y cmake build-essential libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev \ | |
| libyajl-dev libglm-dev libsdl2-image-dev libsqlite3-dev liblua5.4-dev zlib1g-dev \ | |
| pkg-config ninja-build libbox2d-dev=2.4* | |
| - name: Linux | |
| run: | | |
| cmake -GNinja -H. -Bbuild -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build | |
| cmake --install build --component caveexpress --prefix install-caveexpress | |
| cmake --install build --component cavepacker --prefix install-cavepacker | |
| - name: Test | |
| run: | | |
| cd build | |
| ctest | |
| continue-on-error: true | |
| windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: lukka/get-cmake@latest | |
| - name: Setup | |
| uses: lukka/run-vcpkg@v11 | |
| id: vcpkg | |
| env: | |
| VCPKG_DEFAULT_TRIPLET: x64-windows-static | |
| with: | |
| vcpkgGitCommitId: aa628ceb5f15f0c30d4d481f14fa5b2be2b4a658 | |
| runVcpkgInstall: true | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake --version | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DTOOLS=OFF -DUNITTESTS=OFF -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake | |
| cmake --build . | |
| cmake --install . --component caveexpress --prefix install-caveexpress | |
| cmake --install . --component cavepacker --prefix install-cavepacker | |
| - name: Upload the cavepacker artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cavepacker | |
| path: build/cavepacker-install | |
| - name: Upload the caveexpress artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: caveexpress | |
| path: build/caveexpress-install | |
| android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: seanmiddleditch/gha-setup-ninja@master | |
| - uses: nttld/setup-ndk@v1 | |
| id: setup-ndk | |
| with: | |
| local-cache: true | |
| ndk-version: r21e | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '8' | |
| - name: 'Configure Android NDK variables' | |
| shell: sh | |
| run: | | |
| # We cannot use GitHub expressions in the controller job | |
| echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >>$GITHUB_ENV | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake --version | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DTOOLS=OFF -DUNITTESTS=OFF -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/toolchains/android-toolchain.cmake | |
| cmake --build . |