-
Notifications
You must be signed in to change notification settings - Fork 46
137 lines (113 loc) · 3.47 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
name: CI/CD
on:
push:
branches:
- '*'
paths-ignore:
- 'website/**'
- 'README.md'
- 'LICENSE'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
pull_request:
branches:
- 'master'
jobs:
danger-swiftlint:
name: Danger SwiftLint
runs-on: macos-latest
continue-on-error: true
if: github.event_name == 'pull_request'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install SwiftLint and Danger Swift
run: |
brew install swiftlint
brew install danger/tap/danger-swift
- name: Run Danger SwiftLint
run: danger-swift ci
pod-lint:
name: PodLint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install CocoaPods
working-directory: Example
run: pod install
- name: Lint pod library
run: pod lib lint --skip-tests --platforms=macos,ios,tvos
spm-build:
name: Build Swift Package
runs-on: macos-latest
strategy:
matrix:
platform: [iOS, macOS, tvOS, watchOS]
include:
- platform: iOS
destination: 'platform=iOS Simulator,name=iPhone 15'
- platform: macOS
destination: 'platform=macOS'
- platform: tvOS
destination: 'platform=tvOS Simulator,name=Apple TV'
- platform: watchOS
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 2 (49mm)'
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4.0
- name: Install xcbeautify
run: brew install xcbeautify
- name: Build Package for ${{ matrix.platform }}
run: |
xcodebuild build -scheme CrowdinSDK -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]}
build:
name: Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install CocoaPods
working-directory: Example
run: pod install
- name: Install xcbeautify
run: brew install xcbeautify
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4.0
- name: Build
working-directory: Example
run: |
xcodebuild build \
-workspace ./AppleReminders.xcworkspace \
-scheme AppleReminders \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone SE (3rd generation)' | xcbeautify && exit ${PIPESTATUS[0]}
# TODO: ObjCExample
test:
name: Test
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install CocoaPods
working-directory: Tests
run: pod install
- name: Install xcbeautify
run: brew install xcbeautify
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4.0
- name: Tests
working-directory: Tests
run: |
xcodebuild test \
-sdk iphonesimulator \
-workspace ./Tests.xcworkspace \
-scheme Tests \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone SE (3rd generation)' \
-enableCodeCoverage YES | xcbeautify && exit ${PIPESTATUS[0]}
- name: Upload coverage to Codecov
run: cd Tests & bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}