-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.7 KB
/
Build and Test (Xcode App).yml
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
# Build and Test the Xcode App
# This tests the `SwiftProjectTemplateAppPackage` as well as the `SwiftProjectTemplateApp` Xcode project.
name: Build and Test (Xcode)
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
build-and-test-xcode:
strategy:
matrix:
xcode-version:
- "16"
xcode-configuration:
- name: iOS Simulator
destination: "platform=iOS Simulator,name=iPhone 16"
sdk: "iphonesimulator"
- name: macOS
destination: "platform=macOS"
sdk: "macosx"
swift-configuration:
- "debug"
- "release"
runs-on: macos-15
name: Build and Test (${{ matrix.xcode-configuration.name }}, ${{ matrix.swift-configuration }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
- name: Build
run: |
xcrun xcodebuild clean build \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateApp \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
-sdk "${{ matrix.xcode-configuration.sdk }}" \
-destination "${{ matrix.xcode-configuration.destination }}"
- name: SwiftPM Tests
if: matrix.swift-configuration == 'debug'
run: |
xcrun xcodebuild test \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateAppPackage \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
-sdk "${{ matrix.xcode-configuration.sdk }}" \
-destination "${{ matrix.xcode-configuration.destination }}"
- name: UI Tests
run: |
xcrun xcodebuild test \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateAppUITests \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
-sdk "${{ matrix.xcode-configuration.sdk }}" \
-destination "${{ matrix.xcode-configuration.destination }}"
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: Test Results (${{ matrix.xcode-configuration.name }}, ${{ matrix.swift-configuration }})
path: .build/Xcode.noindex/DerivedData/Logs/Test
- name: Check that repository is clean
run:
git diff --exit-code