-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathazure-pipelines-gitTests-template.yml
129 lines (128 loc) · 4.21 KB
/
azure-pipelines-gitTests-template.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
parameters:
- name: POST_RESULT
displayName: Post GitHub issue with results
type: boolean
default: true
- name: DIAGNOSTIC_OUTPUT
displayName: Log diagnostic data
type: boolean
default: false
- name: REPO_COUNT
displayName: Repo Count
type: number
default: 300
- name: REPO_START_INDEX
displayName: Repo Start Index
type: number
default: 0
- name: OLD_VERSION
displayName: Baseline TypeScript package version
type: string
default: latest
- name: NEW_VERSION
displayName: Candidate TypeScript package version
type: string
default: next
- name: MACHINE_COUNT
displayName: Machine Count
type: number
default: 8
- name: ENTRYPOINT
displayName: TypeScript entrypoint
type: string
- name: LANGUAGE
displayName: Language of repos on GitHub (tsserver only)
type: string
- name: PRNG_SEED
displayName: Pseudo-random number generator seed
type: string
default: 'n/a'
jobs:
- job: ListRepos
pool:
name: TypeScript-1ES-Deploys
demands:
- ImageOverride -equals mariner-2.0
steps:
- task: AzureKeyVault@2
inputs:
azureSubscription: 'TypeScript Public CI'
KeyVaultName: 'jststeam-passwords'
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
displayName: Get secrets
retryCountOnTaskFailure: 3
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
mkdir artifacts
node dist/listTopRepos ${{ parameters.LANGUAGE }} ${{ parameters.REPO_COUNT }} ${{ parameters.REPO_START_INDEX }} artifacts/repos.json
displayName: 'List top TS repos'
env:
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)
- publish: artifacts
artifact: RepoList
- job: DetectNewErrors
dependsOn: ListRepos
continueOnError: true
timeoutInMinutes: 360
strategy:
parallel: ${{ parameters.MACHINE_COUNT }}
steps:
- download: current
artifact: RepoList
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
df -h
df -h -i
displayName: Debugging
continueOnError: true
- script: |
npm ci
npm run build
npm install -g yarn
npm install -g pnpm
npm install -g corepack@latest
export COREPACK_ENABLE_AUTO_PIN=0
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export COREPACK_ENABLE_STRICT=0
corepack enable
corepack enable npm
mkdir 'RepoResults$(System.JobPositionInPhase)'
node dist/checkGithubRepos ${{ parameters.ENTRYPOINT }} ${{ parameters.OLD_VERSION }} ${{ parameters.NEW_VERSION }} '$(Pipeline.Workspace)/RepoList/repos.json' $(System.TotalJobsInPhase) $(System.JobPositionInPhase) 'RepoResults$(System.JobPositionInPhase)' ${{ parameters.DIAGNOSTIC_OUTPUT }} ${{ parameters.PRNG_SEED }}
displayName: 'Run TypeScript on repos'
continueOnError: true
- publish: 'RepoResults$(System.JobPositionInPhase)'
artifact: 'RepoResults$(System.JobPositionInPhase)'
- job: ReportNewErrors
dependsOn: DetectNewErrors
pool:
name: TypeScript-1ES-Deploys
demands:
- ImageOverride -equals mariner-2.0
steps:
- task: AzureKeyVault@2
inputs:
azureSubscription: 'TypeScript Public CI'
KeyVaultName: 'jststeam-passwords'
SecretsFilter: 'typescript-bot-github-PAT-error-deltas'
displayName: Get secrets
retryCountOnTaskFailure: 3
- download: current
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
node dist/postGithubIssue ${{ parameters.ENTRYPOINT }} ${{ parameters.LANGUAGE }} ${{ parameters.REPO_COUNT }} ${{ parameters.REPO_START_INDEX }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
displayName: 'Create issue from new errors'
env:
GITHUB_PAT: $(typescript-bot-github-PAT-error-deltas)