forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
164 lines (152 loc) · 4.84 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
name: "Azure OpenAPI"
trigger: none
variables:
TRAVIS: 'true'
TRAVIS_BRANCH: $(System.PullRequest.TargetBranch)
TRAVIS_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)
TRAVIS_REPO_SLUG: $(Build.Repository.Name)
TRAVIS_PULL_REQUEST_SLUG: $(Build.Repository.Name)
TRAVIS_PULL_REQUEST_SHA: $(Build.SourceVersion)
PR_ONLY: 'true'
jobs:
- job: "BranchProtectionForPrivateRepo"
pool:
vmImage: 'Ubuntu 16.04'
condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master'))
steps:
- script: '>&2 echo "the branch is protected"'
failOnStderr: true
- job: "Syntax"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- script: |
echo TRAVIS: $(TRAVIS)
echo TRAVIS_BRANCH: $(TRAVIS_BRANCH)
echo TRAVIS_REPO_SLUG: $(TRAVIS_REPO_SLUG)
echo TRAVIS_PULL_REQUEST: $(TRAVIS_PULL_REQUEST)
echo TRAVIS_PULL_REQUEST_SLUG: $(TRAVIS_PULL_REQUEST_SLUG)
echo TRAVIS_PULL_REQUEST_SHA: $(TRAVIS_PULL_REQUEST_SHA)
echo PR_ONLY: $(PR_ONLY)
displayName: "Info"
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm test -- test/syntax.js'
displayName: 'Syntax validation'
- job: "Semantic"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/semanticValidation.js'
displayName: 'Semantic Validation'
- job: "ModelValidation"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/modelValidation.js'
displayName: 'Model Validation'
- job: "Avocado"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: './node_modules/.bin/avocado'
displayName: 'Avocado'
- job: "BreakingChange"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- script: 'scripts/install-dotnet.sh'
displayName: 'Install .Net'
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/breaking-change.js'
displayName: 'Breaking Changes'
- job: "LintDiff"
variables:
NODE_OPTIONS: '--max-old-space-size=8192'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'scripts/install-dotnet.sh'
displayName: 'install .Net'
- script: 'npm run tsc && node scripts/momentOfTruth.js && node scripts/momentOfTruthPostProcessing.js'
displayName: 'LintDiff'
- job: "SDK"
timeoutInMinutes: 120
strategy:
matrix:
java:
AZURE_SDK_REPO: azure-sdk-for-java
AZURE_SDK_PARAMS: ''
python:
AZURE_SDK_REPO: azure-sdk-for-python
AZURE_SDK_PARAMS: ''
go:
AZURE_SDK_REPO: azure-sdk-for-go
AZURE_SDK_PARAMS: '-o latest'
pool:
vmImage: 'Ubuntu 16.04'
variables:
NODE_OPTIONS: '--max-old-space-size=8192'
steps:
- script: echo $(NODE_OPTIONS)
- script: "scripts/swagger-to-sdk.sh Azure/$(AZURE_SDK_REPO) -v $(AZURE_SDK_PARAMS)"
displayName: "Swagger to SDK script"
- job: "NetworkValidation"
condition: and(startsWith(variables['System.PullRequest.TargetBranch'], 'network-'), endsWith(variables['System.PullRequest.TargetBranch'], '-release'))
continueOnError: true
pool:
vmImage: vs2017-win2016
variables:
NRP_SWAGGER_VALIDATION_OVERRIDE_PS_BRANCH: 'true'
NRP_BUILD_TOOLS_SKIP_GENERATE_PS1: 'true'
NRP_BUILD_TOOLS_OUTPUT_PATH: '$(System.DefaultWorkingDirectory)\Out'
steps:
- powershell: |
& "C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools/sn.exe" -Vr *,31bf3856ad364e35
displayName: Bypass Strong Name validation
- task: NodeTool@0
inputs:
versionSpec: 10.x
displayName: Install Node.js
- script: npm install autorest -g
displayName: Install autorest
- script: git clone --depth 1 -- https://dev.azure.com/v-anevse/BuildScripts/_git/BuildScripts ..\BuildScripts
displayName: Clone build tools
- powershell: |
$swgrPath = (Get-Item ".\").FullName
$outputPath = $env:NRP_BUILD_TOOLS_OUTPUT_PATH
New-Item -Path $outputPath -ItemType "Directory" -Force | Out-Null
..\BuildScripts\Test-SwaggerRelease.ps1 -Component Network -SwaggerRepoPath $swgrPath -OutputFolder $outputPath
failOnStderr: false
displayName: Test Swagger updates
- powershell: |
Copy-Item "..\BuildScripts\.azure-pipelines\.artifactignore" -Destination "$($env:NRP_BUILD_TOOLS_OUTPUT_PATH)\.artifactignore" -Force -ErrorAction "SilentlyContinue"
failOnStderr: false
condition: always()
displayName: Copy .artifactignore
- task: PublishPipelineArtifact@0
condition: always()
inputs:
artifactName: SwaggerTestOutput
targetPath: $(NRP_BUILD_TOOLS_OUTPUT_PATH)