1
+ name : PR_$(Date:yyyy.MM.dd)$(Rev:.rrr)
2
+
3
+ # PR pipeline
4
+ # - Build all targets (netstandard2.0, .NET nanoFramework)
5
+ # - Run tests and upload test coverage to codecov.io
6
+
7
+ trigger : none
8
+ pr :
9
+ branches :
10
+ include :
11
+ - master
12
+ - release/*
13
+ paths :
14
+ exclude :
15
+ - ' *.md'
16
+ - ' *.png'
17
+ - ' *.gitignore'
18
+
19
+ pool :
20
+ vmImage : windows-latest
21
+
22
+ variables :
23
+ - group : common
24
+
25
+ stages :
26
+ - stage : Build
27
+ displayName : Build & test
28
+ jobs :
29
+ - job : Build
30
+ displayName : Build & test
31
+ steps :
32
+ - checkout : self
33
+ fetchDepth : 1
34
+ clean : false
35
+ lfs : true
36
+ submodules : false
37
+ fetchTags : false
38
+
39
+ - task : PowerShell@2
40
+ displayName : ' Build, test, pack'
41
+ inputs :
42
+ filePath : ' Build/build.ps1'
43
+ arguments : ' -IncludeNanoFramework'
44
+ failOnStderr : true
45
+ showWarnings : true
46
+ pwsh : true
47
+ workingDirectory : ' $(Build.SourcesDirectory)'
48
+
49
+ - task : PublishTestResults@2
50
+ condition : always()
51
+ inputs :
52
+ testResultsFormat : " VSTest"
53
+ testResultsFiles : " *.trx"
54
+ searchFolder : $(Build.SourcesDirectory)\Artifacts\TestResults
55
+ mergeTestResults : true
56
+
57
+ - task : PowerShell@2
58
+ displayName : Upload to codecov.io
59
+ env :
60
+ CODECOV_TOKEN : $(CODECOV_TOKEN)
61
+ inputs :
62
+ targetType : ' inline'
63
+ script : |
64
+ Write-Host -Foreground Green "Downloading codecov binaries..."
65
+
66
+ Invoke-WebRequest -Uri https://uploader.codecov.io/verification.gpg -OutFile codecov.asc
67
+ gpg.exe --import codecov.asc
68
+
69
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
70
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM -Outfile codecov.exe.SHA256SUM
71
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM.sig -Outfile codecov.exe.SHA256SUM.sig
72
+
73
+ gpg.exe --verify codecov.exe.SHA256SUM.sig codecov.exe.SHA256SUM
74
+ If ($(Compare-Object -ReferenceObject $(($(certUtil -hashfile codecov.exe SHA256)[1], "codecov.exe") -join " ") -DifferenceObject $(Get-Content codecov.exe.SHA256SUM)).length -eq 0) { echo "SHASUM verified" } Else {exit 1}
75
+
76
+ Write-Host -Foreground Green "Uploading to codecov..."
77
+
78
+ .\codecov.exe --dir "Artifacts/Coverage" -t "$env:CODECOV_TOKEN" --build "$(Build.BuildNumber)"
79
+
80
+ Write-Host -Foreground Green "✅ Uploaded to codecov."
81
+ pwsh : true
82
+
83
+ - publish : $(Build.SourcesDirectory)/Artifacts
84
+ displayName : ' Publish Artifacts'
85
+ artifact : ' Artifacts'
0 commit comments