-
-
Notifications
You must be signed in to change notification settings - Fork 9
141 lines (126 loc) · 7.57 KB
/
build.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
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
name: build
on:
push:
branches: [main, dev]
paths-ignore:
- 'Docs/**' # Docs folder in root of repo
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
pull_request:
branches: [main]
paths-ignore:
- 'Docs/**' # Docs folder in root of repo
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
workflow_dispatch:
schedule:
- cron: '40 11 * * *' # once a day @ 11:40am UTC (4:40am PST)
jobs:
macOS-13:
name: macOS 13 Ventura
runs-on: macos-13
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS" | xcpretty && exit ${PIPESTATUS[0]}
macOS-14:
name: macOS 14 Sonoma (Xcode 15.4)
runs-on: macos-14
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4.0'
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS" | xcpretty && exit ${PIPESTATUS[0]}
macOS:
name: macOS Latest (Latest Stable Xcode)
runs-on: macos-latest
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS" | xcpretty && exit ${PIPESTATUS[0]}
macCatalyst:
name: macCatalyst
runs-on: macos-latest
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=macOS,variant=Mac Catalyst,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS,variant=Mac Catalyst" | xcpretty && exit ${PIPESTATUS[0]}
iOS:
name: iOS
runs-on: macos-latest # this must be macos, GitHub does not offer iOS directly but we can use xcodebuild
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=iOS Simulator,name=Any iOS Device" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=iOS Simulator,name=iPhone 15" | xcpretty && exit ${PIPESTATUS[0]}
tvOS:
name: tvOS
runs-on: macos-latest # this must be macos, GitHub does not offer tvOS directly but we can use xcodebuild
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=tvOS Simulator,name=Any tvOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)" | xcpretty && exit ${PIPESTATUS[0]}
watchOS:
name: watchOS
runs-on: macos-latest # this must be macos, GitHub does not offer watchOS directly but we can use xcodebuild
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=watchOS Simulator,name=Any watchOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)" | xcpretty && exit ${PIPESTATUS[0]}
examples:
name: Examples
runs-on: macos-latest
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default
- name: Movie Timecode - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise
run: xcodebuild -project "Examples/Movie Timecode/Movie Timecode.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]}
- name: Movie Timecode - Build (macOS)
run: xcodebuild build -project "Examples/Movie Timecode/Movie Timecode.xcodeproj" -scheme "Movie Timecode" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: Movie Timecode - Build (iOS)
run: xcodebuild build -project "Examples/Movie Timecode/Movie Timecode.xcodeproj" -scheme "Movie Timecode" -destination "generic/platform=iOS Simulator,name=Any iOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]}
- name: UI Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise
run: xcodebuild -project "Examples/UI Example/UI Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]}
- name: UI Example - Build (macOS)
run: xcodebuild build -project "Examples/UI Example/UI Example.xcodeproj" -scheme "UI Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]}
- name: UI Example - Build (iOS)
run: xcodebuild build -project "Examples/UI Example/UI Example.xcodeproj" -scheme "UI Example" -destination "generic/platform=iOS Simulator,name=Any iOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]}
# xcodebuild test reference:
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/08-automation.html