forked from microsoft/typescript-error-deltas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-userTests.yml
116 lines (113 loc) · 3.48 KB
/
azure-pipelines-userTests.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
parameters:
- name: POST_RESULT
displayName: Post GitHub comment with results
type: boolean
default: true
- name: DIAGNOSTIC_OUTPUT
displayName: Log diagnostic data
type: boolean
default: false
- name: TOP_REPOS
displayName: Query Github for top TS repos by stars
type: boolean
default: false
- name: OLD_TS_REPO_URL
displayName: Old Typscript Repo Url
type: string
default: https://github.com/microsoft/TypeScript.git
- name: OLD_HEAD_REF
displayName: Old head reference
type: string
default: main
- name: REQUESTING_USER
displayName: User to tag when the results are ready
type: string
- name: SOURCE_ISSUE
displayName: PR ID in github
type: number
- name: STATUS_COMMENT
displayName: Typescript-bot comment ID indicating that the run started
type: number
- name: MACHINE_COUNT
displayName: Machine Count
type: number
default: 4
values:
- 1
- 2
- 4
- 8
- name: ENTRYPOINT
displayName: TypeScript entrypoint
type: string
default: tsc
values:
- tsc
- tsserver
- name: PRNG_SEED
displayName: Pseudo-random number generator seed
type: string
default: 'n/a'
pr: none
trigger: none
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: ListRepos
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
mkdir artifacts
- script: node dist/listTopRepos TypeScript 100 0 artifacts/repos.json
condition: eq('${{ parameters.TOP_REPOS }}', 'true')
env:
GITHUB_PAT: $(GITHUB_PAT)
displayName: 'List top TS repos'
- script: node dist/listUserTestRepos ./userTests artifacts/repos.json
condition: ne('${{ parameters.TOP_REPOS }}', 'true')
displayName: 'List user test repos'
- publish: artifacts
artifact: RepoList
- job: DetectNewErrors
dependsOn: ListRepos
timeoutInMinutes: 360
strategy:
parallel: ${{ parameters.MACHINE_COUNT }}
steps:
- download: current
artifact: RepoList
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
npm install -g pnpm
mkdir 'RepoResults$(System.JobPositionInPhase)'
node dist/checkUserTestRepos ${{ parameters.ENTRYPOINT }} ${{ parameters.OLD_TS_REPO_URL }} ${{ parameters.OLD_HEAD_REF }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)/RepoList/repos.json' $(System.TotalJobsInPhase) $(System.JobPositionInPhase) 'RepoResults$(System.JobPositionInPhase)' ${{ parameters.DIAGNOSTIC_OUTPUT }} ${{ parameters.PRNG_SEED }}
displayName: 'Run user tests'
env:
GITHUB_PAT: $(GITHUB_PAT)
- publish: 'RepoResults$(System.JobPositionInPhase)'
artifact: 'RepoResults$(System.JobPositionInPhase)'
- job: ReportNewErrors
dependsOn: DetectNewErrors
steps:
- download: current
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
node dist/postGithubComments ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }}
displayName: 'Update PR comment with new errors'
env:
GITHUB_PAT: $(GITHUB_PAT)