Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: replace macos-12 action runners #1073

Merged
merged 32 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4d97007
ci: replace macos-12 action runners
supervacuus Nov 5, 2024
293ff20
add listing installed images to android start script
supervacuus Nov 5, 2024
a74796f
specify path to android tools for sdkmanager
supervacuus Nov 5, 2024
de1bd42
use cmdline-tools for sdkmanager + avdmanager
supervacuus Nov 5, 2024
a8f562c
switch to macos-14 since macos-15 has no android cmd-tools
supervacuus Nov 5, 2024
a98325b
try x64 macos images
supervacuus Nov 5, 2024
0932333
list sdkmanager images and try to update to check if tooling works at…
supervacuus Nov 5, 2024
d94842d
switch back to macos-15 verify installable setup
supervacuus Nov 5, 2024
b0df4ab
remove update from android start script again
supervacuus Nov 5, 2024
b93e7d2
ensure images are installed
supervacuus Nov 5, 2024
708eff7
accept android image licenses automatically
supervacuus Nov 5, 2024
0cedb2b
pre-accept licenses
supervacuus Nov 5, 2024
10bee8e
start the emulator blocking so we can see any issues during startup
supervacuus Nov 5, 2024
cd215a4
check emulator acceleration before starting the emulator
supervacuus Nov 5, 2024
a75e4f1
switch back x86[_64] images
supervacuus Nov 5, 2024
785692b
re-enable emulator run in background
supervacuus Nov 5, 2024
d80228f
expose llvm18 bin directory for macos15 runners on PATH
supervacuus Nov 5, 2024
ba8661f
revert last commit to macos-15 only
supervacuus Nov 5, 2024
a5099c6
fix quotes
supervacuus Nov 5, 2024
76e1da8
bump old android api/ndk
supervacuus Nov 5, 2024
31cf4fa
lower end android on x86_64 + llvm-cov on macos-15-large
supervacuus Nov 5, 2024
7249358
android lower end only available on x86 + increase timeout to 20 minutes
supervacuus Nov 5, 2024
cf38bfa
install NDK package together with target image
supervacuus Nov 5, 2024
623164c
update lower end android to API level 21 (keep NDK23)
supervacuus Nov 5, 2024
2db625b
switch lower end to API 35 but keep NDK at 23
supervacuus Nov 5, 2024
65f41d0
max API for NDK23 is 31 (but the emulator started)
supervacuus Nov 5, 2024
36b0bb8
define adb and emulator ports
supervacuus Nov 5, 2024
f427713
introduce emulator and adb port to start script
supervacuus Nov 5, 2024
5d1cfed
use ADB_SERVER_PORT as the env variable from the workflow
supervacuus Nov 5, 2024
d79a7c3
start also the non-blocking emulator with the right port
supervacuus Nov 5, 2024
ee9e155
get rid of lower emulator test
supervacuus Nov 5, 2024
d15db90
get rid of emulator and adb port in start-android.sh
supervacuus Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ on:
branches:
- master
- "release/**"
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -35,49 +39,49 @@ jobs:
fail-fast: false
matrix:
include:
- name: Linux (old gcc, 32-bit)
- name: Linux (GCC 7, 32-bit)
os: ubuntu-20.04
CC: gcc-7
CXX: g++-7
TEST_X86: 1
- name: Linux (new gcc)
- name: Linux (GCC 12)
os: ubuntu-22.04
CC: gcc-12
CXX: g++-12
# ERROR_ON_WARNINGS: 1
# The GCC analyzer 10.0.1 (as on CI) has an internal compiler error
# currently, and is not stable enough to activate.
# RUN_ANALYZER: gcc
- name: Linux (clang + asan + llvm-cov)
- name: Linux (clang 15 + asan + llvm-cov)
os: ubuntu-22.04
CC: clang-15
CXX: clang++-15
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: asan,llvm-cov
- name: Linux (clang + kcov)
- name: Linux (clang 15 + kcov)
os: ubuntu-22.04
CC: clang-15
CXX: clang++-15
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: kcov
- name: Linux (gcc + code-checker + valgrind)
- name: Linux (gcc 12 + code-checker + valgrind)
os: ubuntu-22.04
RUN_ANALYZER: code-checker,valgrind
- name: macOS (xcode llvm)
os: macOs-14
- name: macOS 14 (xcode llvm)
os: macos-14
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
- name: macOS 13 (xcode llvm)
os: macOs-13
os: macos-13
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
- name: macOS (xcode llvm + universal)
os: macOs-14
- name: macOS 14 (xcode llvm + universal)
os: macos-14
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
CMAKE_DEFINES: -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
- name: macOS (clang + asan + llvm-cov)
os: macOs-12
- name: macOS 15 (clang 18 + asan + llvm-cov)
os: macos-15-large
CC: clang
CXX: clang++
ERROR_ON_WARNINGS: 1
Expand All @@ -95,15 +99,16 @@ jobs:
MINGW_ASM_MASM_COMPILER: llvm-ml;-m64
# The Android emulator is currently only available on macos, see:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator
- name: Android (old API/NDK)
os: macOs-12
ANDROID_API: 16
ANDROID_NDK: 20.1.5948944
ANDROID_ARCH: x86
- name: Android (new API/NDK)
os: macOs-12
ANDROID_API: 34
ANDROID_NDK: 26.1.10909125
# TODO: switch to reactivecircus/android-emulator-runner, concurrently running emulators continuously fail now.
# - name: Android (API 31, NDK 23)
# os: macos-15-large
# ANDROID_API: 31
# ANDROID_NDK: 23.2.8568313
# ANDROID_ARCH: x86_64
- name: Android (API 35, NDK 27)
os: macos-15-large
ANDROID_API: 35
ANDROID_NDK: 27.2.12479018
ANDROID_ARCH: x86_64

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

- name: Expose llvm PATH for Mac
- name: Expose llvm@15 PATH for Mac
if: ${{ runner.os == 'macOS' }}
run: echo $(brew --prefix llvm@15)/bin >> $GITHUB_PATH


- name: Expose llvm@18 PATH for Mac
if: ${{ runner.os == 'macOS' && matrix.os == 'macos-15-large' && matrix.RUN_ANALYZER == 'asan,llvm-cov' }}
run: echo $(brew --prefix llvm@18)/bin >> $GITHUB_PATH

- name: Installing LLVM-MINGW Dependencies
if: ${{ runner.os == 'Windows' && env['TEST_MINGW'] }}
shell: powershell
Expand All @@ -168,19 +177,10 @@ jobs:
shell: powershell
run: . "scripts\install-zlib.ps1"

- name: Installing Android SDK Dependencies
if: ${{ env['ANDROID_API'] }}
run: |
export ANDROID_IMAGE="system-images;android-$ANDROID_API;google_apis;$ANDROID_ARCH"
echo "Downloading ndk;$ANDROID_NDK and $ANDROID_IMAGE"
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install \
"ndk;$ANDROID_NDK" "$ANDROID_IMAGE" | \
grep -v "\[=" || true # suppress the progress bar, so we get meaningful logs

- name: Starting Android Simulator
if: ${{ env['ANDROID_API'] }}
run: bash scripts/start-android.sh
timeout-minutes: 10
timeout-minutes: 20

- name: Test
shell: bash
Expand Down
22 changes: 20 additions & 2 deletions scripts/start-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,44 @@ echo "PATH: $PATH"

ARCH=${ANDROID_ARCH:-"x86"}
API_LEVEL=${ANDROID_API:-"29"}
NDK_VERSION=${ANDROID_NDK:-"27.2.12479018"}
AVD_EMULATOR_NAME="sentry_android_${ARCH}"
IMAGE=${ANDROID_IMAGE:-"system-images;android-${API_LEVEL};google_apis;${ARCH}"}
NDK_PACKAGE=${NDK_IMAGE:-"ndk;${NDK_VERSION}"}

# Create an Android Virtual Device
echo "Create Test AVDs with..."
echo "ARCH = $ARCH"
echo "API_LEVEL = $API_LEVEL"
echo "AVD_EMULATOR_NAME = $AVD_EMULATOR_NAME"
echo "IMAGE = $IMAGE"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force
echo "NDK_PACKAGE = $NDK_PACKAGE"

echo "Install image and NDK..."
yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "$IMAGE"
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "$NDK_PACKAGE"

echo "Create AVD..."
echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force

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

echo "Check emulator acceleration..."
$ANDROID_HOME/emulator/emulator -accel-check

# Start emulator in background
echo "Starting emulator..."
nohup $ANDROID_HOME/emulator/emulator -avd $AVD_EMULATOR_NAME -no-snapshot > /dev/null 2>&1 &

# For debugging emulator start issues:
# echo "Starting emulator blocking..."
# $ANDROID_HOME/emulator/emulator -avd $AVD_EMULATOR_NAME -no-snapshot

echo "Wait for emulator availability..."
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'ls'
echo "Verify emulator devices as running..."
echo "Verify emulator devices are running..."
$ANDROID_HOME/platform-tools/adb devices

echo "Emulator started."
Loading