Skip to content

Commit be882e4

Browse files
ci: Workaround for GH actions to recache runtimes (#6076)
List the available simulators as a workaround for GH actions to recache and detect missing runtimes.
1 parent 7b3399c commit be882e4

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ jobs:
192192
steps:
193193
- uses: actions/checkout@v5
194194

195+
- run: ./scripts/ci-select-xcode.sh 16.4
196+
195197
- name: Build for Debug
196198
run: |
197199
./scripts/sentry-xcodebuild.sh \
@@ -218,6 +220,8 @@ jobs:
218220
steps:
219221
- uses: actions/checkout@v5
220222

223+
- run: ./scripts/ci-select-xcode.sh 16.4
224+
221225
- name: Build for Release
222226
run: |
223227
./scripts/sentry-xcodebuild.sh \
@@ -244,6 +248,8 @@ jobs:
244248
steps:
245249
- uses: actions/checkout@v5
246250

251+
- run: ./scripts/ci-select-xcode.sh 16.4
252+
247253
- name: Build for Debug
248254
run: |
249255
./scripts/sentry-xcodebuild.sh \
@@ -270,6 +276,8 @@ jobs:
270276
steps:
271277
- uses: actions/checkout@v5
272278

279+
- run: ./scripts/ci-select-xcode.sh 16.4
280+
273281
- name: Build for Release
274282
run: |
275283
./scripts/sentry-xcodebuild.sh \

scripts/ci-select-xcode.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,33 @@
77

88
set -euo pipefail
99

10+
# Disable SC1091 because it won't work with pre-commit
11+
# shellcheck source=./scripts/ci-utils.sh disable=SC1091
12+
source "$(cd "$(dirname "$0")" && pwd)/ci-utils.sh"
13+
1014
XCODE_VERSION="${1}"
1115

1216
# We prefer this over calling `sudo xcode-select` because it will fail if the Xcode version
1317
# is not installed. Also xcodes is preinstalled on the GH runners.
1418
xcodes select "$XCODE_VERSION"
1519
swiftc --version
20+
21+
22+
begin_group "List Available Simulators"
23+
24+
# On GH actions this command should cause the GH actions to recache and detect missing runtimes, as pointed out in
25+
# https://github.com/actions/runner-images/issues/12948#issuecomment-3248563014
26+
# The command is fast and should avoids problems we had with GH actions not having specific simulators installed
27+
# see https://github.com/getsentry/sentry-cocoa/pull/6053.
28+
29+
start_time=$(date +%s)
30+
31+
xcrun simctl list
32+
33+
end_time=$(date +%s)
34+
xcrun_simctl_list_duration=$((end_time - start_time))
35+
36+
end_group
37+
38+
# We want to log the duration after the group, because otherwise it's hidden at the end of the group.
39+
echo "List Available Simulators completed in ${xcrun_simctl_list_duration} seconds"

0 commit comments

Comments
 (0)