forked from weichsel/ZIPFoundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
166 lines (156 loc) · 4.92 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
trigger:
- master
jobs:
- job: Linux_Swift_5_0
pool:
vmImage: 'Ubuntu 16.04'
# We currently can't use the official Swift Docker image, because it no longer comes with with zlib dependency
container: norionomura/swift:5.0.0
steps:
- script: swift test -c release -Xswiftc -enable-testing
displayName: Linux Swift 5.0
- job: Linux_Swift_4_2
pool:
vmImage: 'Ubuntu 16.04'
container: swift:4.2
steps:
- script: swift test -c release -Xswiftc -enable-testing
displayName: Linux Swift 4.2
- job: Linux_Swift_4_1
pool:
vmImage: 'Ubuntu 16.04'
container: swift:4.1
steps:
- script: swift test -c release -Xswiftc -enable-testing
displayName: Linux Swift 4.1
- job: Linux_Swift_4_0
pool:
vmImage: 'Ubuntu 16.04'
container: swift:4.0
steps:
- script: swift test -c release -Xswiftc -enable-testing
displayName: Linux Swift 4.0
- job: macOS_10_14
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
- task: Xcode@5
inputs:
actions: 'test'
packageApp: false
exportMethod: 'development'
exportOptionsPlist: ''
configuration: 'Release'
scheme: 'ZIPFoundation'
sdk: 'macosx'
destinationPlatformOption: 'macOS'
useXcpretty: true
publishJUnitResults: true
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
failTaskOnFailedTests: true
- job: iOS_12_1
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
- task: Xcode@5
inputs:
actions: 'test'
packageApp: false
exportMethod: 'development'
exportOptionsPlist: ''
configuration: 'Release'
scheme: 'ZIPFoundation'
sdk: 'iphonesimulator'
destinationPlatformOption: 'iOS'
destinationTypeOption: 'simulators'
destinationSimulators: 'iPhone 11'
useXcpretty: true
publishJUnitResults: true
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
failTaskOnFailedTests: true
- job: watchOS_5_1
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
# We currently only perform a build-only script for watchOS (xcodebuild test is unable to find the XCTest module)
- task: Xcode@5
inputs:
actions: 'build'
packageApp: false
exportMethod: 'development'
exportOptionsPlist: ''
configuration: 'Release'
scheme: 'ZIPFoundation'
sdk: 'watchsimulator'
destinationPlatformOption: 'custom'
destinationTypeOption: 'simulators'
destinationSimulators: 'Apple Watch Series 3 - 38mm'
- job: tvOS_12_1
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
- task: Xcode@5
inputs:
actions: 'test'
packageApp: false
exportMethod: 'development'
exportOptionsPlist: ''
configuration: 'Release'
scheme: 'ZIPFoundation'
sdk: 'appletvsimulator'
destinationPlatformOption: 'tvOS'
destinationTypeOption: 'simulators'
destinationSimulators: 'Apple TV 4K'
useXcpretty: true
publishJUnitResults: true
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
failTaskOnFailedTests: true
- job: SwiftLint
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
- script: xcodebuild -scheme ZIPFoundation 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: |
set -o pipefail
mkdir -p build/reports/
swiftlint lint --reporter junit > build/reports/swiftlint.xml
displayName: SwiftLint
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: build/reports/**
failTaskOnFailedTests: true
- script: swiftlint analyze --strict --compiler-log-path xcodebuild.log
displayName: SwiftLint Analyze
- job: CodeCoverage
pool:
vmImage: 'macOS 10.14'
variables:
DEVELOPER_DIR: /Applications/Xcode_11.2.app
steps:
- script: xcodebuild test -destination 'platform=macOS,arch=x86_64' -scheme "ZIPFoundation" -derivedDataPath Build/
displayName: Generate xccovreport
- script: (xcrun xccov view --only-targets --report Build/Logs/Test/*.xcresult | grep -Eq "ZIPFoundation.*100\.00%") && { exit 0; } || { echo '##vso[task.logissue type=error;]Please make sure that the test suite covers all framework code paths.'; exit 1; }
displayName: Check for full line coverage