forked from jpsim/Yams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
182 lines (177 loc) · 6.01 KB
/
azure-pipelines.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
trigger:
- master
jobs:
- job: linux
pool:
vmImage: 'Ubuntu 16.04'
strategy:
maxParallel: 10
matrix:
swift40:
containerImage: norionomura/swiftlint:swift-4.0
swift41:
containerImage: norionomura/swiftlint:swift-4.1
swift42:
containerImage: norionomura/swiftlint:swift-4.2
swift50:
containerImage: swift:5.0
swift51:
containerImage: norionomura/swift:swift-5.1-branch
container: $[ variables['containerImage'] ]
steps:
- script: swift test --parallel
displayName: swift test with UTF16
env:
YAMS_DEFAULT_ENCODING: UTF16
- script: swift test --parallel
displayName: swift test with UTF8
env:
YAMS_DEFAULT_ENCODING: UTF8
- script: |
set -o pipefail
mkdir -p build/reports/
swiftlint lint --reporter junit > build/reports/swiftlint.xml
displayName: swiftlint
condition: contains(variables['containerImage'], 'swiftlint')
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
- job: macOS
pool:
vmImage: $[ coalesce(variables['VM_IMAGE'], 'macOS 10.13') ]
strategy:
maxParallel: 10
matrix:
xcode901:
DEVELOPER_DIR: /Applications/Xcode_9.0.1.app
xcode91:
DEVELOPER_DIR: /Applications/Xcode_9.1.app
xcode92:
DEVELOPER_DIR: /Applications/Xcode_9.2.app
xcode931:
DEVELOPER_DIR: /Applications/Xcode_9.3.1.app
xcode941:
DEVELOPER_DIR: /Applications/Xcode_9.4.1.app
xcode10:
DEVELOPER_DIR: /Applications/Xcode_10.app
VM_IMAGE: 'macOS 10.14'
XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO
xcode101:
DEVELOPER_DIR: /Applications/Xcode_10.1.app
VM_IMAGE: 'macOS 10.14'
XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO
xcode102:
DEVELOPER_DIR: /Applications/Xcode_10.2.app
VM_IMAGE: 'macOS 10.14'
XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO
SKIP_32_BIT_TESTS: true
steps:
- script: |
xcodebuild -version
echo "##vso[task.setvariable variable=XCODE_FLAGS]-scheme Yams $XCODE_FLAGS_FOR_TEST"
displayName: xcodebuild -version & set XCODE_FLAGS
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS test |
xcpretty -r junit -o build/reports/xcodebuild-macos.xml
displayName: tests on macOS with UTF16
condition: succeededOrFailed()
env:
YAMS_DEFAULT_ENCODING: UTF16
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS test |
xcpretty -r junit -o build/reports/xcodebuild-macos-utf8.xml
displayName: tests on macOS with UTF8
condition: succeededOrFailed()
env:
YAMS_DEFAULT_ENCODING: UTF8
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS test -sdk iphonesimulator -destination "name=iPhone 8" |
xcpretty -r junit -o build/reports/xcodebuild-iOS.xml
displayName: tests on iOS
condition: succeededOrFailed()
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS test -sdk iphonesimulator -destination "name=iPhone 5" |
xcpretty -r junit -o build/reports/xcodebuild-iOS.xml
displayName: tests on iOS (32-bit)
condition: and(succeededOrFailed(), ne(variables['SKIP_32_BIT_TESTS'], 'true'))
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS test -sdk appletvsimulator -destination "name=Apple TV 4K" |
xcpretty -r junit -o build/reports/xcodebuild-tvOS.xml
displayName: tests on tvOS
condition: succeededOrFailed()
- script: >
set -o pipefail &&
xcodebuild $XCODE_FLAGS build -sdk watchsimulator -destination "name=Apple Watch Series 3 - 38mm"
displayName: build on watchOS
condition: succeededOrFailed()
- script: >
set -o pipefail &&
swift test --parallel
displayName: swift test with UTF16
condition: succeededOrFailed()
env:
YAMS_DEFAULT_ENCODING: UTF16
- script: >
set -o pipefail &&
swift test --parallel
displayName: swift test with UTF8
condition: succeededOrFailed()
env:
YAMS_DEFAULT_ENCODING: UTF8
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
condition: succeededOrFailed()
- job: CocoaPods
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_10.2.app
steps:
- script: bundle install --path vendor/bundle
displayName: bundle install
- script: bundle exec pod lib lint --verbose
displayName: pod lib lint
- job: Analyze
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_10.2.app
steps:
- script: xcodebuild -scheme Yams clean build-for-testing > xcodebuild.log
displayName: Generate xcodebuild.log
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install https://raw.github.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb
displayName: Install SwiftLint
- script: swiftlint analyze --strict --compiler-log-path xcodebuild.log
displayName: Run SwiftLint Analyze
- job: jazzy
pool:
vmImage: 'Ubuntu 16.04'
container: norionomura/jazzy:0.9.6_swift-4.2.4
steps:
- script: bundle install --path vendor/bundle
displayName: bundle install
- script: swift build
displayName: swift build
- script: sourcekitten doc --spm-module Yams > yams.json
displayName: Generate documentation json
- script: bundle exec jazzy --clean --sourcekitten-sourcefile yams.json
displayName: Run jazzy
- script: >
if ruby -rjson -e "j = JSON.parse(File.read('docs/undocumented.json')); exit j['warnings'].length != 0"; then
echo "Undocumented declarations:"
cat docs/undocumented.json
exit 1
fi
displayName: Validate documentation coverage
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'API Docs'
targetPath: 'docs'