-
Notifications
You must be signed in to change notification settings - Fork 327
/
apidoctor.validation.yml
120 lines (105 loc) · 3.95 KB
/
apidoctor.validation.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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Pipeline for validating Microsoft Graph docs using API Doctor
trigger:
branches:
include:
- live
- main
pr:
branches:
include:
- live
- main
parameters:
- name: useNuGetPackage
displayName: "Use API Doctor NuGet Package (If disabled, source code from GitHub will be used)?"
type: boolean
default: true
- name: apiDoctorNuGetVersion
default: "1.2.2312.152"
displayName: "API Doctor NuGet Package Version"
- name: apiDoctorGitRepoUrl
default: "https://github.com/OneDrive/apidoctor.git"
displayName: "API Doctor Git Repo URL"
- name: apiDoctorGitBranch
default: "master"
displayName: "API Doctor Git branch"
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
sdl:
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.azure-pipelines\.config\CredScanSuppressions.json
baseline:
baselineFile: $(Build.SourcesDirectory)\.gdn\.gdnbaselines
suppression:
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: ValidateDocs
displayName: "Validate docs"
jobs:
- job: RunAPIDoctorScript
displayName: "Run API Doctor script"
variables:
USE_NUGET_PACKAGE: ${{ parameters.useNuGetPackage }}
API_DOCTOR_NUGET_VERSION: ${{ parameters.apiDoctorNuGetVersion }}
API_DOCTOR_GIT_REPO_URL: ${{ parameters.apiDoctorGitRepoUrl }}
API_DOCTOR_GIT_BRANCH: ${{ parameters.apiDoctorGitBranch }}
steps:
- pwsh: |
Write-Host "Executing API Doctor script with the following parameters:"
if ($env:USE_NUGET_PACKAGE -eq $true) {
if ([string]::IsNullOrWhiteSpace($env:USE_NUGET_PACKAGE)) {
Write-Host "API Doctor NuGet package version has not been set. Aborting..."
exit 1
}
Write-Host " - API Doctor NuGet Version: $($env:API_DOCTOR_NUGET_VERSION)"
}
else {
if ([string]::IsNullOrWhiteSpace($env:API_DOCTOR_GIT_REPO_URL)) {
Write-Host "API Doctor Git Repo URL has not been set. Aborting..."
exit 1
}
Write-Host " - API Doctor Git Repo URL: $($env:API_DOCTOR_GIT_REPO_URL)"
Write-Host " - API Doctor Git Branch: $($env:API_DOCTOR_GIT_BRANCH)"
}
displayName: "Evaluate pipeline parameters"
- checkout: self
displayName: "Checkout Microsoft Graph docs"
clean: true
fetchDepth: 1
- task: UseDotNet@2
displayName: "Use .NET Core SDK 6.x"
inputs:
version: 6.x
- task: UseDotNet@2
displayName: "Use .NET Core SDK 8.x"
inputs:
version: 8.x
- task: PowerShell@2
displayName: "Validate v1.0 docs"
env:
DOCS_SUB_PATH: \api-reference\v1.0
inputs:
filePath: Test-Docs.ps1
arguments: -cleanUp
- task: PowerShell@2
displayName: "Validate beta docs"
env:
DOCS_SUB_PATH: \api-reference\beta
inputs:
filePath: Test-Docs.ps1
arguments: -cleanUp