-
Notifications
You must be signed in to change notification settings - Fork 6
191 lines (168 loc) · 7.4 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
name: Test
on:
push:
branches:
- '*'
- '*/**'
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'LICENSE'
- 'NOTICE'
- '.tools/create-release'
- '.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-13, java: '8' }
- { os: macos-13, java: '11' }
- { os: macos-13, java: '17' }
- { os: macos-13, 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', compiler_version: 11 }
- { os: ubuntu-latest, java: '8', compiler: 'gcc', compiler_version: 12 }
- { os: ubuntu-latest, java: '8', compiler: 'gcc', compiler_version: 13 }
- { os: ubuntu-24.04, java: '8', compiler: 'gcc', compiler_version: 14 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 13 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 14 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 15 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 16 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 17 }
- { os: ubuntu-latest, java: '8', compiler: 'clang', compiler_version: 18 }
- { os: ubuntu-latest, java: '17', compiler: 'gcc', compiler_version: 11 }
- { os: ubuntu-latest, java: '17', compiler: 'gcc', compiler_version: 12 }
- { os: ubuntu-latest, java: '17', compiler: 'gcc', compiler_version: 13 }
- { os: ubuntu-24.04, java: '17', compiler: 'gcc', compiler_version: 14 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 13 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 14 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 15 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 16 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 17 }
- { os: ubuntu-latest, java: '17', compiler: 'clang', compiler_version: 18 }
- { os: ubuntu-latest, java: '21', compiler: 'gcc', compiler_version: 11 }
- { os: ubuntu-latest, java: '21', compiler: 'gcc', compiler_version: 12 }
- { os: ubuntu-latest, java: '21', compiler: 'gcc', compiler_version: 13 }
- { os: ubuntu-24.04, java: '21', compiler: 'gcc', compiler_version: 14 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 13 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 14 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 15 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 16 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 17 }
- { os: ubuntu-latest, java: '21', compiler: 'clang', compiler_version: 18 }
steps:
- uses: actions/checkout@v4
- name: System Setup
shell: bash
run: |
if [[ '${{ matrix.os }}' == ubuntu-* ]]; then
if [[ '${{ matrix.compiler }}' == 'clang' ]]; then
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh ${{ matrix.compiler_version }}
sudo apt-get install -y clang-tools-${{ matrix.compiler_version }}
echo "CC=clang-${{ matrix.compiler_version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.compiler_version }}" >> $GITHUB_ENV
fi
if [[ '${{ matrix.compiler }}' == 'gcc' ]]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.compiler_version }} g++-${{ matrix.compiler_version }}
echo "CC=gcc-${{ matrix.compiler_version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.compiler_version }}" >> $GITHUB_ENV
fi
fi
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: |
8
${{ matrix.java }}
distribution: 'temurin'
- name: Configure CMake
shell: bash
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build and Test Native
shell: bash
run: cmake --build build --config $BUILD_TYPE --target test-native
- name: Build and Test JniGen
shell: bash
run: cmake --build build --config $BUILD_TYPE --target test-jnigen
- name: Upload JDK crashes
if: failure() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: JNI_Crash_Logs_${{ matrix.os }}_${{ matrix.java }}
path: |
tests/build/hs_*.log
tests/build/hs_*.mdmp
android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: AVD cache
uses: actions/cache@v4
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}}
sdcard-path-or-size: 1000M
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}}
sdcard-path-or-size: 1000M
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 test-native
echo "::endgroup::"
echo "::group::Build and Test JniGen"
cmake --build build --config $BUILD_TYPE --target test-jnigen
echo "::endgroup::"