|
1 | | -if ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_BRANCH.StartsWith("try-")) { |
2 | | - $lintOutput = (Resolve-Path .\testOutput\lint\) |
3 | | - $lintSource = (Resolve-Path .\tests\lint\) |
4 | | - $flake8Output = "$lintOutput\Flake8.txt" |
5 | | - # When Appveyor runs for a pr, |
6 | | - # the build is made from a new temporary commit, |
7 | | - # resulting from the pr branch being merged into its base branch. |
8 | | - # Therefore to create a diff for linting, we must fetch the head of the base branch. |
9 | | - # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. |
10 | | - # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. |
11 | | - if($env:APPVEYOR_PULL_REQUEST_NUMBER) { |
12 | | - git fetch -q origin $env:APPVEYOR_REPO_BRANCH |
13 | | - $msgBaseLabel = "PR" |
14 | | - } else { |
15 | | - # However in a pushed branch, we must fetch master. |
16 | | - git fetch -q origin master:master |
17 | | - $msgBaseLabel = "Branch" |
18 | | - } |
19 | | - .\runlint.bat FETCH_HEAD "$flake8Output" |
20 | | - if($LastExitCode -ne 0) { |
21 | | - Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode |
22 | | - Add-AppveyorMessage "FAIL: Lint check. See test results for more information." |
23 | | - } else { |
24 | | - Add-AppveyorMessage "PASS: Lint check." |
25 | | - } |
26 | | - Push-AppveyorArtifact $flake8Output |
27 | | - $junitXML = "$lintOutput\PR-Flake8.xml" |
28 | | - py "$lintSource\createJunitReport.py" "$flake8Output" "$junitXML" |
29 | | - Push-AppveyorArtifact $junitXML |
30 | | - $wc = New-Object 'System.Net.WebClient' |
31 | | - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $junitXML) |
| 1 | +$lintOutput = (Resolve-Path .\testOutput\lint\) |
| 2 | +$lintOutput = "$lintOutput\PR-lint.xml" |
| 3 | +.\runlint.bat "$lintOutput" |
| 4 | +if ($LastExitCode -ne 0) { |
| 5 | + Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode |
| 6 | + Add-AppveyorMessage "FAIL: Lint check. See test results for more information." |
| 7 | +} else { |
| 8 | + Add-AppveyorMessage "PASS: Lint check." |
32 | 9 | } |
| 10 | +Push-AppveyorArtifact $lintOutput |
| 11 | +$wc = New-Object 'System.Net.WebClient' |
| 12 | +$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $lintOutput) |
0 commit comments