Skip to content

Commit 038be6f

Browse files
committed
Fix and update GitHub Actions workflow for Xcode builds
- Update action dependencies - Switch from `xcversion` to `xcodes` - Update target devices and runtimes
1 parent 2f5d43c commit 038be6f

File tree

2 files changed

+23
-35
lines changed

2 files changed

+23
-35
lines changed

.github/actions/prepare-simulator/action.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ outputs:
1414
runs:
1515
using: composite
1616
steps:
17-
- name: "Print bundled runtimes"
18-
shell: bash
19-
run: |
20-
echo "::group::Bundled runtimes:"
21-
for xcode in /Applications/Xcode*.app; do \
22-
echo $xcode | grep -o "Xcode.*\.app"; \
23-
for plist in $xcode/Contents/Developer/Platforms/*.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/*.simruntime/Contents/Info.plist; do \
24-
defaults read $plist CFBundleName; \
25-
done; \
26-
echo ""; \
27-
done
28-
echo "::endgroup::"
29-
3017
- name: "Install runtime"
3118
shell: bash
3219
run: |
@@ -36,9 +23,9 @@ runs:
3623
echo "$RUNTIME is already installed.";
3724
else
3825
echo "::group::Available runtimes:"
39-
xcversion simulators
26+
xcodes runtimes
4027
echo "::endgroup::"
41-
xcversion simulators --install="$RUNTIME";
28+
sudo xcodes runtimes install "$RUNTIME" --keep-archive;
4229
fi
4330
4431
- name: "Create and boot simulator"
@@ -47,8 +34,8 @@ runs:
4734
run: |
4835
RUNTIME="${{ inputs.runtime }}"
4936
DEVICE="${{ inputs.device }}"
50-
DEVICE_ID=com.apple.CoreSimulator.SimDeviceType.$(echo $DEVICE | sed -E -e "s/[ \-]+/ /g" -e "s/[^[:alnum:]]/-/g")
51-
RUNTIME_ID=com.apple.CoreSimulator.SimRuntime.$(echo $RUNTIME | sed -E -e "s/[ \-]+/ /g" -e "s/[^[:alnum:]]/-/g")
37+
DEVICE_ID=com.apple.CoreSimulator.SimDeviceType.$(echo $DEVICE | sed -E -e "s/[ \-]+/ /g" -e "s/[\(\)]//g" -e "s/[^[:alnum:]]/-/g")
38+
RUNTIME_ID=com.apple.CoreSimulator.SimRuntime.$(echo $RUNTIME | sed -E -e "s/[ \-]+/ /g" -e "s/[\(\)]//g" -e "s/[^[:alnum:]]/-/g")
5239
DESTINATION_ID=$(xcrun simctl create "Custom: $DEVICE, $RUNTIME" $DEVICE_ID $RUNTIME_ID)
5340
xcrun simctl boot $DESTINATION_ID
5441
echo "destination-id=$(echo $DESTINATION_ID)" >> $GITHUB_OUTPUT

.github/workflows/xcode.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
matrix:
1111
env:
1212
- xcode: 15.4
13-
runtime: "iOS 15.5"
14-
device: "iPhone 13 Pro"
13+
runtime: "iOS 17.5"
14+
device: "iPhone 15 Pro Max"
1515
- xcode: 15.4
16-
runtime: "iOS 14.5"
17-
device: "iPhone 12 Pro Max"
16+
runtime: "iOS 16.4"
17+
device: "iPhone 12 mini"
1818
- xcode: 15.4
19-
runtime: "iOS 13.7"
20-
device: "iPhone 11"
19+
runtime: "iOS 15.5"
20+
device: "iPhone SE"
2121
steps:
2222
- uses: actions/checkout@v4
2323
with:
@@ -27,9 +27,9 @@ jobs:
2727
with:
2828
version: ${{ matrix.env.xcode }}
2929
- name: "Cache downloaded simulator runtimes"
30-
uses: actions/cache@v3
30+
uses: actions/cache@v4
3131
with:
32-
path: ~/Library/Caches/XcodeInstall/*.dmg
32+
path: ~/Downloads/*.dmg
3333
key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }}
3434
- name: "Prepare simulator"
3535
id: prepare-simulator
@@ -41,11 +41,12 @@ jobs:
4141
run: |
4242
set -o pipefail
4343
xcodebuild test -project "OneTimePassword.xcodeproj" -scheme "OneTimePassword (iOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c
44-
- uses: sersoft-gmbh/swift-coverage-action@v3
44+
- uses: sersoft-gmbh/swift-coverage-action@v4
4545
with:
4646
target-name-filter: ^OneTimePassword$
47-
- uses: codecov/codecov-action@v3
47+
- uses: codecov/codecov-action@v4
4848
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}
4950
fail_ci_if_error: true
5051

5152
watchos:
@@ -55,14 +56,14 @@ jobs:
5556
matrix:
5657
env:
5758
- xcode: 15.4
58-
runtime: "watchOS 8.5"
59-
device: "Apple Watch Series 7 - 45mm"
59+
runtime: "watchOS 10.5"
60+
device: "Apple Watch Ultra 2 (49mm)"
6061
- xcode: 15.4
61-
runtime: "watchOS 7.4"
62-
device: "Apple Watch Series 6 - 44mm"
62+
runtime: "watchOS 9.4"
63+
device: "Apple Watch SE (44mm) (2nd generation)"
6364
- xcode: 15.4
64-
runtime: "watchOS 6.2"
65-
device: "Apple Watch Series 4 - 40mm"
65+
runtime: "watchOS 8.5"
66+
device: "Apple Watch Series 3 (38mm)"
6667
steps:
6768
- uses: actions/checkout@v4
6869
with:
@@ -72,9 +73,9 @@ jobs:
7273
with:
7374
version: ${{ matrix.env.xcode }}
7475
- name: "Cache downloaded simulator runtimes"
75-
uses: actions/cache@v3
76+
uses: actions/cache@v4
7677
with:
77-
path: ~/Library/Caches/XcodeInstall/*.dmg
78+
path: ~/Downloads/*.dmg
7879
key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }}
7980
- name: "Prepare simulator"
8081
id: prepare-simulator

0 commit comments

Comments
 (0)