-
Notifications
You must be signed in to change notification settings - Fork 6
205 lines (183 loc) · 5.68 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: Test
on:
push:
branches:
- '*'
- '*/**'
paths-ignore:
- 'README.md'
- '.gitignore'
- 'LICENSE'
- '.github/workflows/publish.yml'
env:
BUILD_TYPE: Release
NDK_VER: 21.3.6528147
NDK_ARCH: x86_64
NDK_API: 29
jobs:
desktop:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
java: '8'
- os: macos-latest
java: '11'
- os: macos-latest
java: '17'
- os: macos-latest
java: '21'
- os: windows-latest
java: '8'
- os: windows-latest
java: '11'
- os: windows-latest
java: '17'
- os: windows-latest
java: '21'
- os: ubuntu-latest
java: '8'
compiler: 'gcc-11|g++-11'
- os: ubuntu-latest
java: '8'
compiler: 'gcc-12|g++-12'
- os: ubuntu-latest
java: '8'
compiler: 'gcc-13|g++-13'
- os: ubuntu-latest
java: '8'
compiler: 'clang-13|clang++-13'
- os: ubuntu-latest
java: '8'
compiler: 'clang-14|clang++-14'
- os: ubuntu-latest
java: '8'
compiler: 'clang-15|clang++-15'
- os: ubuntu-latest
java: '17'
compiler: 'gcc-11|g++-11'
- os: ubuntu-latest
java: '17'
compiler: 'gcc-12|g++-12'
- os: ubuntu-latest
java: '17'
compiler: 'gcc-13|g++-13'
- os: ubuntu-latest
java: '17'
compiler: 'clang-13|clang++-13'
- os: ubuntu-latest
java: '17'
compiler: 'clang-14|clang++-14'
- os: ubuntu-latest
java: '17'
compiler: 'clang-15|clang++-15'
- os: ubuntu-latest
java: '21'
compiler: 'gcc-11|g++-11'
- os: ubuntu-latest
java: '21'
compiler: 'gcc-12|g++-12'
- os: ubuntu-latest
java: '21'
compiler: 'gcc-13|g++-13'
- os: ubuntu-latest
java: '21'
compiler: 'clang-13|clang++-13'
- os: ubuntu-latest
java: '21'
compiler: 'clang-14|clang++-14'
- os: ubuntu-latest
java: '21'
compiler: 'clang-15|clang++-15'
steps:
- uses: actions/checkout@v3
- name: System Setup
shell: bash
run: |
if [[ '${{ matrix.os }}' == 'ubuntu-latest' ]]; then
if [[ '${{ matrix.compiler}}' == 'clang-15|clang++-15' ]]; then
sudo apt-get update
sudo apt-get install -y clang-15 clang++-15
fi
if [[ '${{ matrix.compiler }}' == 'gcc-12|g++-12' ]]; then
sudo apt-get update
sudo apt-get install -y gcc-12 g++-12
fi
if [[ '${{ matrix.compiler }}' == 'gcc-13|g++-13' ]]; then
sudo apt-get update
sudo apt-get install -y gcc-13 g++-13
fi
fi
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: |
8
${{ matrix.java }}
distribution: 'temurin'
- name: Configure CMake
shell: bash
run: |
if [[ '${{ matrix.compiler }}' != '' ]]; then
IFS='|' read -ra COMPILER <<< '${{ matrix.compiler }}'
export CC=${COMPILER[0]}
export CXX=${COMPILER[1]}
fi
cmake -S . -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build and Test Native
shell: bash
run: cmake --build build --config $BUILD_TYPE --target run-jar
- name: Build and Test JniGen
shell: bash
run: cmake --build build --config $BUILD_TYPE --target test-jnigen
android:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{env.NDK_VER}}-${{env.NDK_ARCH}}-${{env.NDK_API}}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{env.NDK_API}}
arch: ${{env.NDK_ARCH}}
target: google_apis
ndk: ${{env.NDK_VER}}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Configure, Build and Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{env.NDK_API}}
arch: ${{env.NDK_ARCH}}
target: google_apis
ndk: ${{env.NDK_VER}}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
echo "::group::Configure"
cmake -S . -B build -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$ANDROID_SDK_ROOT/ndk/$NDK_VER/build/cmake/android.toolchain.cmake -DANDROID_ABI:STRING=$NDK_ARCH -DANDROID_PLATFORM:STRING=19 -DANDROID_STL:STRING=c++_static
echo "::endgroup::"
echo "::group::Build and Test Native"
cmake --build build --config $BUILD_TYPE --target run-app
echo "::endgroup::"
echo "::group::Build and Test JniGen"
cmake --build build --config $BUILD_TYPE --target test-jnigen
echo "::endgroup::"