Skip to content

Commit 683201f

Browse files
authored
ci: replace macos-12 action runners (#1073)
* ci: replace macos-12 action runners * add listing installed images to android start script * specify path to android tools for sdkmanager * use cmdline-tools for sdkmanager + avdmanager * switch to macos-14 since macos-15 has no android cmd-tools * try x64 macos images * list sdkmanager images and try to update to check if tooling works at all * switch back to macos-15 verify installable setup * remove update from android start script again * ensure images are installed * accept android image licenses automatically * pre-accept licenses * start the emulator blocking so we can see any issues during startup * check emulator acceleration before starting the emulator * switch back x86[_64] images * re-enable emulator run in background * expose llvm18 bin directory for macos15 runners on PATH * revert last commit to macos-15 only * fix quotes * bump old android api/ndk * lower end android on x86_64 + llvm-cov on macos-15-large * android lower end only available on x86 + increase timeout to 20 minutes * install NDK package together with target image * update lower end android to API level 21 (keep NDK23) * switch lower end to API 35 but keep NDK at 23 * max API for NDK23 is 31 (but the emulator started) * define adb and emulator ports * introduce emulator and adb port to start script * use ADB_SERVER_PORT as the env variable from the workflow * start also the non-blocking emulator with the right port * get rid of lower emulator test * get rid of emulator and adb port in start-android.sh
1 parent ad6df21 commit 683201f

File tree

2 files changed

+53
-35
lines changed

2 files changed

+53
-35
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ on:
55
branches:
66
- master
77
- "release/**"
8+
paths-ignore:
9+
- "*.md"
810
pull_request:
11+
paths-ignore:
12+
- "*.md"
913

1014
concurrency:
1115
group: ${{ github.workflow }}-${{ github.ref }}
@@ -35,49 +39,49 @@ jobs:
3539
fail-fast: false
3640
matrix:
3741
include:
38-
- name: Linux (old gcc, 32-bit)
42+
- name: Linux (GCC 7, 32-bit)
3943
os: ubuntu-20.04
4044
CC: gcc-7
4145
CXX: g++-7
4246
TEST_X86: 1
43-
- name: Linux (new gcc)
47+
- name: Linux (GCC 12)
4448
os: ubuntu-22.04
4549
CC: gcc-12
4650
CXX: g++-12
4751
# ERROR_ON_WARNINGS: 1
4852
# The GCC analyzer 10.0.1 (as on CI) has an internal compiler error
4953
# currently, and is not stable enough to activate.
5054
# RUN_ANALYZER: gcc
51-
- name: Linux (clang + asan + llvm-cov)
55+
- name: Linux (clang 15 + asan + llvm-cov)
5256
os: ubuntu-22.04
5357
CC: clang-15
5458
CXX: clang++-15
5559
ERROR_ON_WARNINGS: 1
5660
RUN_ANALYZER: asan,llvm-cov
57-
- name: Linux (clang + kcov)
61+
- name: Linux (clang 15 + kcov)
5862
os: ubuntu-22.04
5963
CC: clang-15
6064
CXX: clang++-15
6165
ERROR_ON_WARNINGS: 1
6266
RUN_ANALYZER: kcov
63-
- name: Linux (gcc + code-checker + valgrind)
67+
- name: Linux (gcc 12 + code-checker + valgrind)
6468
os: ubuntu-22.04
6569
RUN_ANALYZER: code-checker,valgrind
66-
- name: macOS (xcode llvm)
67-
os: macOs-14
70+
- name: macOS 14 (xcode llvm)
71+
os: macos-14
6872
ERROR_ON_WARNINGS: 1
6973
SYSTEM_VERSION_COMPAT: 0
7074
- name: macOS 13 (xcode llvm)
71-
os: macOs-13
75+
os: macos-13
7276
ERROR_ON_WARNINGS: 1
7377
SYSTEM_VERSION_COMPAT: 0
74-
- name: macOS (xcode llvm + universal)
75-
os: macOs-14
78+
- name: macOS 14 (xcode llvm + universal)
79+
os: macos-14
7680
ERROR_ON_WARNINGS: 1
7781
SYSTEM_VERSION_COMPAT: 0
7882
CMAKE_DEFINES: -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
79-
- name: macOS (clang + asan + llvm-cov)
80-
os: macOs-12
83+
- name: macOS 15 (clang 18 + asan + llvm-cov)
84+
os: macos-15-large
8185
CC: clang
8286
CXX: clang++
8387
ERROR_ON_WARNINGS: 1
@@ -95,15 +99,16 @@ jobs:
9599
MINGW_ASM_MASM_COMPILER: llvm-ml;-m64
96100
# The Android emulator is currently only available on macos, see:
97101
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator
98-
- name: Android (old API/NDK)
99-
os: macOs-12
100-
ANDROID_API: 16
101-
ANDROID_NDK: 20.1.5948944
102-
ANDROID_ARCH: x86
103-
- name: Android (new API/NDK)
104-
os: macOs-12
105-
ANDROID_API: 34
106-
ANDROID_NDK: 26.1.10909125
102+
# TODO: switch to reactivecircus/android-emulator-runner, concurrently running emulators continuously fail now.
103+
# - name: Android (API 31, NDK 23)
104+
# os: macos-15-large
105+
# ANDROID_API: 31
106+
# ANDROID_NDK: 23.2.8568313
107+
# ANDROID_ARCH: x86_64
108+
- name: Android (API 35, NDK 27)
109+
os: macos-15-large
110+
ANDROID_API: 35
111+
ANDROID_NDK: 27.2.12479018
107112
ANDROID_ARCH: x86_64
108113

109114
name: ${{ matrix.name }}
@@ -151,10 +156,14 @@ jobs:
151156
if: ${{ contains(env['RUN_ANALYZER'], 'code-checker') }}
152157
run: sudo snap install codechecker --classic
153158

154-
- name: Expose llvm PATH for Mac
159+
- name: Expose llvm@15 PATH for Mac
155160
if: ${{ runner.os == 'macOS' }}
156161
run: echo $(brew --prefix llvm@15)/bin >> $GITHUB_PATH
157-
162+
163+
- name: Expose llvm@18 PATH for Mac
164+
if: ${{ runner.os == 'macOS' && matrix.os == 'macos-15-large' && matrix.RUN_ANALYZER == 'asan,llvm-cov' }}
165+
run: echo $(brew --prefix llvm@18)/bin >> $GITHUB_PATH
166+
158167
- name: Installing LLVM-MINGW Dependencies
159168
if: ${{ runner.os == 'Windows' && env['TEST_MINGW'] }}
160169
shell: powershell
@@ -168,19 +177,10 @@ jobs:
168177
shell: powershell
169178
run: . "scripts\install-zlib.ps1"
170179

171-
- name: Installing Android SDK Dependencies
172-
if: ${{ env['ANDROID_API'] }}
173-
run: |
174-
export ANDROID_IMAGE="system-images;android-$ANDROID_API;google_apis;$ANDROID_ARCH"
175-
echo "Downloading ndk;$ANDROID_NDK and $ANDROID_IMAGE"
176-
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install \
177-
"ndk;$ANDROID_NDK" "$ANDROID_IMAGE" | \
178-
grep -v "\[=" || true # suppress the progress bar, so we get meaningful logs
179-
180180
- name: Starting Android Simulator
181181
if: ${{ env['ANDROID_API'] }}
182182
run: bash scripts/start-android.sh
183-
timeout-minutes: 10
183+
timeout-minutes: 20
184184

185185
- name: Test
186186
shell: bash

scripts/start-android.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,44 @@ echo "PATH: $PATH"
1111

1212
ARCH=${ANDROID_ARCH:-"x86"}
1313
API_LEVEL=${ANDROID_API:-"29"}
14+
NDK_VERSION=${ANDROID_NDK:-"27.2.12479018"}
1415
AVD_EMULATOR_NAME="sentry_android_${ARCH}"
1516
IMAGE=${ANDROID_IMAGE:-"system-images;android-${API_LEVEL};google_apis;${ARCH}"}
17+
NDK_PACKAGE=${NDK_IMAGE:-"ndk;${NDK_VERSION}"}
1618

1719
# Create an Android Virtual Device
1820
echo "Create Test AVDs with..."
1921
echo "ARCH = $ARCH"
2022
echo "API_LEVEL = $API_LEVEL"
2123
echo "AVD_EMULATOR_NAME = $AVD_EMULATOR_NAME"
2224
echo "IMAGE = $IMAGE"
23-
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force
25+
echo "NDK_PACKAGE = $NDK_PACKAGE"
26+
27+
echo "Install image and NDK..."
28+
yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
29+
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "$IMAGE"
30+
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "$NDK_PACKAGE"
31+
32+
echo "Create AVD..."
33+
echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force
2434

2535
echo "List available AVDs..."
2636
$ANDROID_HOME/emulator/emulator -list-avds
2737

38+
echo "Check emulator acceleration..."
39+
$ANDROID_HOME/emulator/emulator -accel-check
40+
2841
# Start emulator in background
2942
echo "Starting emulator..."
3043
nohup $ANDROID_HOME/emulator/emulator -avd $AVD_EMULATOR_NAME -no-snapshot > /dev/null 2>&1 &
44+
45+
# For debugging emulator start issues:
46+
# echo "Starting emulator blocking..."
47+
# $ANDROID_HOME/emulator/emulator -avd $AVD_EMULATOR_NAME -no-snapshot
48+
3149
echo "Wait for emulator availability..."
3250
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'ls'
33-
echo "Verify emulator devices as running..."
51+
echo "Verify emulator devices are running..."
3452
$ANDROID_HOME/platform-tools/adb devices
3553

3654
echo "Emulator started."

0 commit comments

Comments
 (0)