Skip to content

Commit f0c3793

Browse files
committed
Implement a simple CI and move tests to iOS
1 parent 45854b2 commit f0c3793

36 files changed

Lines changed: 36 additions & 0 deletions

.github/workflows/tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: macos-26
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: List available simulators
16+
run: xcrun simctl list devices available
17+
18+
- name: Run tests
19+
run: |
20+
xcodebuild test \
21+
-scheme AudioSnapshotTesting \
22+
-destination 'platform=iOS Simulator,name=iPad Pro 13-inch (M5),OS=latest' \
23+
-resultBundlePath TestResults.xcresult
24+
continue-on-error: true
25+
26+
- name: Upload test results
27+
if: always()
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: test-results
31+
path: TestResults.xcresult
32+
retention-days: 30

Sources/AudioSnapshotTesting/SpectrogramView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ struct SpectrogramView: View {
3131
self.imageWidth = width
3232
let cgImage = CGImage.spectrogramImage(data: data, width: width, height: height)
3333
let platformImage = PlatformImage.withRotated(cgImage: cgImage)
34+
#if os(macOS)
3435
image = Image(nsImage: platformImage)
36+
#else
37+
image = Image(uiImage: platformImage)
38+
#endif
3539
}
3640

3741
var body: some View {
1.13 MB
Loading
2.02 MB
Loading
193 KB
Loading
190 KB
Loading
174 KB
Loading
189 KB
Loading
4.86 MB
Loading
37.9 KB
Loading

0 commit comments

Comments
 (0)