Skip to content

Commit 40bc996

Browse files
committed
Add CI for Android
1 parent d0954c2 commit 40bc996

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
cc: clang
4747
cxx: clang++
4848
name: Linux-x64-clang
49+
- runner: ubuntu-latest
50+
name: Android
4951
build_type:
5052
- Debug
5153
- Release
@@ -62,7 +64,7 @@ jobs:
6264
brew bundle install
6365
6466
- name: Install Linux dependencies
65-
if: ${{ matrix.os.preset == 'linux' }}
67+
if: ${{ matrix.os.preset == 'linux' || matrix.os.name == 'Android' }}
6668
run: |
6769
sudo apt update
6870
sudo apt install -y --no-install-recommends \
@@ -71,30 +73,45 @@ jobs:
7173
- name: Install Windows dependencies
7274
if: ${{ matrix.os.runner == 'windows-latest' }}
7375
run: choco install ninja
74-
76+
7577
- uses: ilammy/msvc-dev-cmd@v1
7678
if: ${{ matrix.os.runner == 'windows-latest' }}
7779
with:
7880
arch: win64
7981

82+
- uses: actions/setup-java@v4
83+
if: ${{ matrix.os.name == 'Android' }}
84+
with:
85+
java-version: '17'
86+
distribution: 'temurin'
87+
88+
- name: Build APK
89+
if: ${{ matrix.os.name == 'Android' }}
90+
run: ./gradlew build
91+
8092
- name: Configure CMake
93+
if: ${{ matrix.os.name != 'Android' }}
8194
env:
8295
CC: ${{ matrix.os.cc }}
8396
CXX: ${{ matrix.os.cxx }}
8497
VCPKG_ROOT: C:/vcpkg
8598
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON
8699

87100
- name: Build ${{ matrix.build_type }}
101+
if: ${{ matrix.os.name != 'Android' }}
88102
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose
89103

90104
- name: Run ${{ matrix.build_type }} Unittests
105+
if: ${{ matrix.os.name != 'Android' }}
91106
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}
92107

93108
- name: Local install
109+
if: ${{ matrix.os.name != 'Android' }}
94110
# There no cmake install presets so install in traditional way
95111
run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }}
96112

97113
- name: Upload Artifacts
114+
if: ${{ matrix.os.name != 'Android' }}
98115
uses: actions/upload-artifact@v4
99116
with:
100117
name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }}

0 commit comments

Comments
 (0)