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 : PowerShell@2
50
+ displayName : Upload to codecov.io
51
+ env :
52
+ CODECOV_TOKEN : $(CODECOV_TOKEN)
53
+ inputs :
54
+ targetType : ' inline'
55
+ script : |
56
+ Write-Host -Foreground Green "Downloading codecov binaries..."
57
+
58
+ Invoke-WebRequest -Uri https://uploader.codecov.io/verification.gpg -OutFile codecov.asc
59
+ gpg.exe --import codecov.asc
60
+
61
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
62
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM -Outfile codecov.exe.SHA256SUM
63
+ Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM.sig -Outfile codecov.exe.SHA256SUM.sig
64
+
65
+ gpg.exe --verify codecov.exe.SHA256SUM.sig codecov.exe.SHA256SUM
66
+ 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}
67
+
68
+ Write-Host -Foreground Green "Uploading to codecov..."
69
+
70
+ .\codecov.exe --dir "Artifacts/Coverage" -t "$env:CODECOV_TOKEN" --build "$(Build.BuildNumber)"
71
+
72
+ Write-Host -Foreground Green "✅ Uploaded to codecov."
73
+ pwsh : true
74
+
75
+ - publish : $(Build.SourcesDirectory)/Artifacts
76
+ displayName : ' Publish Artifacts'
77
+ artifact : ' Artifacts'
0 commit comments