forked from timfraedrich/OutRun
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.27 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (70 loc) · 2.27 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
name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- '.superpowers/**'
- 'LICENSE'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- '.superpowers/**'
- 'LICENSE'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- name: Install SwiftLint
run: brew install swiftlint
- name: Lint
run: swiftlint lint --reporter github-actions-logging
test:
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- name: Copy Secrets
run: cp Secrets.xcconfig.example Secrets.xcconfig
- name: Boot Simulator
run: |
# Pre-boot so cold-boot latency doesn't eat xcodebuild's launch
# timeout. The macos-26 runner intermittently hung with the test
# runner never beginning execution when boot raced the test host.
xcrun simctl boot "iPhone 17 Pro" || true
xcrun simctl bootstatus "iPhone 17 Pro" -b
- name: Build and Test
run: |
# Retry once with a clean simulator re-boot in between: the
# macos-26 sim occasionally wedges on launch (tests never start).
# -quiet dropped so a genuine failure is actually diagnosable.
run_tests() {
xcodebuild test \
-workspace Pilgrim.xcworkspace \
-scheme Pilgrim \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
-skip-testing:ScreenshotTests \
-resultBundlePath "TestResults-$1.xcresult" \
CODE_SIGNING_ALLOWED=NO
}
if run_tests 1; then exit 0; fi
echo "::warning::Test run 1 failed — resetting simulator and retrying"
xcrun simctl shutdown "iPhone 17 Pro" || true
xcrun simctl boot "iPhone 17 Pro" || true
xcrun simctl bootstatus "iPhone 17 Pro" -b
run_tests 2
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults-*.xcresult
retention-days: 7
if-no-files-found: ignore