-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (92 loc) · 3.19 KB
/
Copy pathci.yml
File metadata and controls
110 lines (92 loc) · 3.19 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
pull_request:
branches: [develop]
push:
branches: [develop]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: false
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.2"
- name: Compute LFS cache key
run: |
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Pull LFS files
run: git lfs pull
- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods dependencies
run: pod install
- name: Cache Swift Package dependencies
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Resolve Swift Package dependencies
run: xcodebuild -resolvePackageDependencies -workspace GAMSS.xcworkspace -scheme GAMSS-Debug
- name: Build (Debug)
run: |
xcodebuild build \
-workspace GAMSS.xcworkspace \
-scheme GAMSS-Debug \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO
- name: Build (Release)
run: |
xcodebuild build \
-workspace GAMSS.xcworkspace \
-scheme GAMSS-Release \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO
- name: Resolve simulator UDID
id: simulator
run: |
UDID=$(xcrun simctl list devices available --json | jq -r '
.devices
| to_entries
| map(select(.key | test("^com\\.apple\\.CoreSimulator\\.SimRuntime\\.iOS-")))
| map(select(.key | capture("iOS-(?<maj>[0-9]+)-(?<min>[0-9]+)") as $v
| ($v.maj | tonumber) > 18 or (($v.maj | tonumber) == 18 and ($v.min | tonumber) >= 1)))
| map(.value[])
| map(select(.isAvailable == true and (.name | startswith("iPhone"))))
| (map(select(.name == "iPhone 16")) + .)
| .[0].udid // empty
')
if [ -z "$UDID" ]; then
echo "No iOS 18.1+ iPhone simulator found (preferring 'iPhone 16')." >&2
xcrun simctl list devices available >&2
exit 1
fi
echo "Resolved simulator UDID: $UDID"
echo "udid=$UDID" >> "$GITHUB_OUTPUT"
- name: Test
run: |
xcodebuild test \
-workspace GAMSS.xcworkspace \
-scheme GAMSS-Debug \
-destination "id=${{ steps.simulator.outputs.udid }}" \
CODE_SIGNING_ALLOWED=NO