forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
129 lines (122 loc) · 4.04 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
trigger:
- main
jobs:
- job: Sourcery
pool:
vmImage: 'macOS-12'
steps:
- script: brew install sourcery
displayName: Install Sourcery
- script: make --always-make sourcery
displayName: Generate sources
- script: "! git diff -U0 | grep '^[-+][^-+]' | grep --invert-match '// Generated using Sourcery'"
displayName: Check changed files ignoring Sourcery's version
- job: Linux
pool:
vmImage: 'ubuntu-latest'
strategy:
maxParallel: 10
matrix:
swift56:
containerImage: swift:5.6
container: $[ variables['containerImage'] ]
steps:
- script: swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
displayName: swift test
- job: Xcode
pool:
vmImage: 'macOS-12'
strategy:
maxParallel: 10
matrix:
xcode1341:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
steps:
- script: |
sw_vers
xcodebuild -version
displayName: Version Informations
- script: xcodebuild -scheme swiftlint test -destination "platform=macOS" OTHER_SWIFT_FLAGS="-D DISABLE_FOCUSED_EXAMPLES"
displayName: xcodebuild test
- job: SwiftPM
pool:
vmImage: 'macOS-12'
strategy:
maxParallel: 10
matrix:
xcode1341:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
steps:
- script: |
sw_vers
xcodebuild -version
displayName: Version Informations
- script: swift test --parallel --enable-code-coverage -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
displayName: swift test
- script: |
xcrun llvm-cov export -format="lcov" .build/debug/SwiftLintPackageTests.xctest/Contents/MacOS/SwiftLintPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
bash <(curl -s https://codecov.io/bash)
displayName: Upload code coverage
condition: eq(variables['DEVELOPER_DIR'], '/Applications/Xcode_13.2.1.app')
- job: CocoaPods
pool:
vmImage: 'macOS-12'
variables:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
steps:
- script: bundle install --path vendor/bundle
displayName: bundle install
- script: bundle exec pod repo update
displayName: pod repo update
- script: bundle exec pod lib lint --verbose
displayName: pod lib lint
- job: TSan
pool:
vmImage: 'macOS-12'
variables:
DEVELOPER_DIR: /Applications/Xcode_13.3.1.app
steps:
- script: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.12.2/bazelisk-darwin-amd64 -o bazelisk
chmod +x bazelisk
displayName: Install Bazel
- script: echo "build --remote_cache=grpc://[email protected]:9092" > ci.bazelrc
env:
BAZEL_REMOTE_CREDENTIALS: $(BAZEL_REMOTE_CREDENTIALS)
displayName: Set CI Bazel flags
- script: ./bazelisk build -c opt --features=tsan swiftlint
displayName: Build SwiftLint
- script: ./bazel-bin/swiftlint --lenient
displayName: Pre-cache SwiftLint Run
- script: ./bazel-bin/swiftlint --lenient
displayName: Post-cache SwiftLint Run
- job: jazzy
pool:
vmImage: 'macOS-12'
variables:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
steps:
- script: swift run swiftlint generate-docs
displayName: Run swiftlint generate-docs
- script: bundle install --path vendor/bundle
displayName: bundle install
- script: bundle exec jazzy
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'
- task: DownloadSecureFile@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
secureFile: doc_deploy_key
- script: ./tools/push-docs
displayName: Publish
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')