forked from sozercan/kaset
-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (161 loc) · 5.93 KB
/
Copy pathtests.yml
File metadata and controls
179 lines (161 loc) · 5.93 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Test Suite
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- "**.swift"
- "Package.swift"
- "Info.plist"
- "Kaset.entitlements"
- "Sources/**"
- "Scripts/**"
- "Tests/**"
- ".github/workflows/tests.yml"
pull_request:
branches: [main]
paths:
- "**.swift"
- "Package.swift"
- "Info.plist"
- "Kaset.entitlements"
- "Sources/**"
- "Scripts/**"
- "Tests/**"
- ".github/workflows/tests.yml"
workflow_dispatch:
jobs:
macos_unit_tests:
name: macOS Unit Tests (${{ matrix.os }})
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-15 covers the Sequoia fallback paths (LegacyFallbackViews,
# `else` branches of LiquidGlassCompat). macos-26 covers the Tahoe
# Liquid Glass paths.
os: [macos-26, macos-15]
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4
- name: Select Xcode version
run: |
set -euo pipefail
# Swift 6.2 requires Xcode 26.x. Both runner images carry one or
# more Xcode 26.x installs; prefer the newest available.
for candidate in \
/Applications/Xcode_26.2.app \
/Applications/Xcode_26.1.app \
/Applications/Xcode_26.0.app \
/Applications/Xcode_26.app
do
if [ -d "$candidate" ]; then
sudo xcode-select -s "$candidate/Contents/Developer"
echo "Selected $candidate"
xcodebuild -version
exit 0
fi
done
echo "::error::No Xcode 26.x install found on $RUNNER_NAME" >&2
ls /Applications | grep -i xcode || true
exit 1
- name: Show Swift version
run: swift --version
- name: Cache SPM dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/Library/Caches/org.swift.swiftpm/spm-repositories
.build
key: ${{ runner.os }}-${{ matrix.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-spm-
- name: Clear SPM binary artifacts cache
run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts
- name: Run unit tests
# --disable-xctest avoids a swiftpm-xctest-helper segfault on macOS 15
# (Xcode 26 + Sequoia) during XCTest discovery. The unit suite is
# entirely Swift Testing; the only XCTest target is the manual
# ParserPerformanceTests, which is invoked separately via xcodebuild.
run: swift test -q --skip KasetUITests --disable-xctest
macos_ui_tests:
name: macOS UI Tests (${{ matrix.os }})
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-15 exercises Sequoia fallback UI paths; macos-26 exercises
# the full Tahoe Liquid Glass / Apple Intelligence UI paths.
os: [macos-26, macos-15]
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4
- name: Select Xcode version
run: |
set -euo pipefail
for candidate in \
/Applications/Xcode_26.2.app \
/Applications/Xcode_26.1.app \
/Applications/Xcode_26.0.app \
/Applications/Xcode_26.app
do
if [ -d "$candidate" ]; then
sudo xcode-select -s "$candidate/Contents/Developer"
echo "Selected $candidate"
xcodebuild -version
exit 0
fi
done
echo "::error::No Xcode 26.x install found on $RUNNER_NAME" >&2
ls /Applications | grep -i xcode || true
exit 1
- name: Show Xcode version
run: xcodebuild -version
- name: Cache SPM dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/Library/Caches/org.swift.swiftpm/spm-repositories
.build
key: ${{ runner.os }}-${{ matrix.os }}-spm-ui-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-spm-ui-
- name: Clear SPM binary artifacts cache
run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts
- name: Build app bundle for UI tests
env:
KASET_SIGNING: adhoc
# Xcode 26 actool cannot distill Icon Composer assets on macos-15
# runners, but UI tests only need a launchable bundle.
KASET_SKIP_MAIN_ASSETS: ${{ matrix.os == 'macos-15' && '1' || '0' }}
run: Scripts/build-app.sh debug
- name: Verify packaged app
run: Scripts/verify-release-app.sh .build/app/Kaset.app
- name: Install app for UI tests
run: |
sudo cp -R .build/app/Kaset.app /Applications/Kaset.app
# Register with Launch Services so XCUIApplication can find it
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/Kaset.app
- name: Run UI tests
run: |
set -o pipefail
xcodebuild \
-project KasetUITests.xcodeproj \
-scheme KasetUITests \
-destination 'platform=macOS' \
-derivedDataPath ./build \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
test
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
with:
name: macOS-UITestResults-${{ matrix.os }}
path: ./build/*.xcresult
retention-days: 7