-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (90 loc) · 3.26 KB
/
ci.yml
File metadata and controls
96 lines (90 loc) · 3.26 KB
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
name: "Construct CI"
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: LFS pull
run: git lfs pull
- name: Select Xcode 26.2
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.2"
- name: Prepare Firebase config for CI
env:
GOOGLE_SERVICE_INFO_PLIST_BASE64: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_BASE64 }}
GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }}
run: ./.github/scripts/prepare-firebase-config.sh
- name: Resolve iOS simulator destination
id: destination
shell: bash
run: |
set -euo pipefail
show_destinations="$(xcodebuild -showdestinations -project "App/Construct.xcodeproj" -scheme "Construct")"
pick_simulator_id() {
local name_filter="$1"
echo "$show_destinations" | awk -v name="$name_filter" '
/platform:iOS Simulator/ && index($0, "name:" name) {
if (match($0, /id:[^,}]+/)) {
id = substr($0, RSTART + 3, RLENGTH - 3)
gsub(/[[:space:]]/, "", id)
print id
exit
}
}
'
}
destination_id="$(pick_simulator_id "iPhone 16 Pro")" # Prefer @3x device for snapshots
if [ -z "$destination_id" ]; then
destination_id="$(echo "$show_destinations" | awk '
/platform:iOS Simulator/ && /name:iPhone/ {
if (match($0, /id:[^,}]+/)) {
id = substr($0, RSTART + 3, RLENGTH - 3)
gsub(/[[:space:]]/, "", id)
print id
exit
}
}
')"
fi
if [ -z "$destination_id" ]; then
echo "No iOS Simulator destination found"
echo "$show_destinations"
exit 1
fi
echo "destination=id=$destination_id" >> "$GITHUB_OUTPUT"
- name: iOS tests (excluding UI tests)
run: |
set -o pipefail
env NSUnbufferedIO=YES xcodebuild \
-project "App/Construct.xcodeproj" \
-scheme "Construct" \
-destination "${{ steps.destination.outputs.destination }}" \
-derivedDataPath ./build \
-skipPackagePluginValidation \
-skipMacroValidation \
-skip-testing:ConstructUITests \
clean test | xcpretty
- name: UI tests (ConstructUITests)
run: |
set -o pipefail
env NSUnbufferedIO=YES xcodebuild \
-project "App/Construct.xcodeproj" \
-scheme "Construct" \
-destination "${{ steps.destination.outputs.destination }}" \
-derivedDataPath ./build \
-parallel-testing-enabled NO \
-maximum-concurrent-test-simulator-destinations 1 \
-skipPackagePluginValidation \
-skipMacroValidation \
-only-testing:ConstructUITests \
test | xcpretty
- name: Archive test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
build/Logs/Test