-
Notifications
You must be signed in to change notification settings - Fork 565
/
Copy pathclang-format-ci.yml
61 lines (50 loc) · 1.43 KB
/
clang-format-ci.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
name: $(Year:yy).$(Month).$(DayOfMonth).$(rev:r)
pr:
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
- script: |
npm i -g npm@latest
displayName: 'npm i -g npm@latest'
workingDirectory: source/nodejs
- script: |
npm install
displayName: 'npm install'
workingDirectory: source/nodejs
- script: |
npm run verify --verbose
displayName: 'npm run verify --verbose'
workingDirectory: source/nodejs
- bash: |
echo "##[command]Three ways to fix the format problem"
echo '##[command]1. powershell -ExecutionPolicy Bypass scripts\FormatSource.ps1 -ModifiedOnly $False'
echo "##[command]2. or cd source\nodejs, then npm run format --verbse"
echo "##[command]3. or download format.patch from pippeline, then git apply format.patch"
displayName: 'How to fix the format problem'
condition: failed()
- script: |
npm run format --verbose
displayName: 'npm run format --verbose'
workingDirectory: source/nodejs
condition: failed()
- script: |
git diff > format.patch
displayName: 'create format.patch'
condition: failed()
- task: CopyFiles@2
inputs:
contents: 'format.patch'
targetFolder: $(Build.ArtifactStagingDirectory)
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: drop
condition: failed()