Repository navigation
109 lines (93 loc) · 4.2 KB
/
Copy pathios-tests.yml
File metadata and controls
109 lines (93 loc) · 4.2 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
name: iOS and Package Tests
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ios-tests-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
changes:
name: Changes (iOS)
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
run: ${{ steps.decide.outputs.run }}
oracle: ${{ steps.decide.outputs.oracle }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Decide which suites run
id: decide
env:
BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
set -euo pipefail
run=$(scripts/ci/detect-changed-paths.sh --base "$BASE" ios)
oracle=$(scripts/ci/detect-changed-paths.sh --base "$BASE" oracle)
{ echo "run=$run"; echo "oracle=$oracle"; } >> "$GITHUB_OUTPUT"
# The required check, with no gate job: see macos-tests.yml. TableProCore and TableProOracle run
# here under swift test, never in an Xcode test plan: a plan target that depends on the package
# TableProPluginKit makes the app and plugins compile against its module, not the framework.
ios:
name: iOS and Package Tests
needs: changes
if: ${{ !cancelled() && needs.changes.outputs.run != 'false' }}
runs-on: xcode-27
timeout-minutes: 50
env:
DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-xcode
- uses: ./.github/actions/setup-xcodegen
- name: Download static libraries
env:
GH_TOKEN: ${{ github.token }}
run: scripts/download-libs.sh
- name: Generate the Xcode project
run: scripts/generate-project.sh ios
# The image ships the iOS 27.0 runtime. Downloading the one for Xcode's newer SDK costs minutes.
- name: Make sure the simulator exists
run: |
if ! xcrun simctl list devices available | grep -F "iPhone 18 Pro (" > /dev/null; then
sudo xcodebuild -downloadPlatform iOS
fi
# One simulator, not clones: on a 3-core runner a second booted simulator killed runs with
# "(ipc/mig) server died", and TableProMobileTests is one bundle that never split anyway.
- name: Run the iOS tests
run: |
set -o pipefail
xcodebuild test \
-project TableProMobile/TableProMobile.xcodeproj -scheme TableProMobile \
-destination "$DESTINATION" -only-testing:TableProMobileTests \
-parallel-testing-enabled NO \
-skipPackagePluginValidation -resultBundlePath iOS.xcresult \
CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO \
| xcbeautify --renderer github-actions
# --parallel is what makes swift test write the XCTest xunit file. Without it only the Swift
# Testing one appears, and TableProOracle's cases are all XCTest.
- name: Run the TableProCore package tests
if: ${{ !cancelled() }}
run: swift test --package-path Packages/TableProCore --parallel --xunit-output Core.xml
# Pinned to the tracked Package.resolved, so a manifest bump that forgets the lockfile fails.
- name: Run the TableProOracle package tests
if: ${{ !cancelled() && needs.changes.outputs.oracle != 'false' }}
run: swift test --package-path Packages/TableProOracle --force-resolved-versions --parallel --xunit-output Oracle.xml
# Fails the job when a bundle or a package ran zero tests, which both tools report as success.
- name: Summarize the results
if: ${{ !cancelled() }}
run: scripts/ci/summarize-xcresult.sh iOS.xcresult Core.xml Oracle.xml
- name: Upload the result bundle
if: ${{ failure() }}
continue-on-error: true
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ios-tests-${{ github.run_attempt }}
path: iOS.xcresult
if-no-files-found: ignore
retention-days: 7