From 8085516ab0c27d79cf5ec6564f44a6c85a72bea3 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 15:19:22 +1000 Subject: [PATCH 1/7] increase git clone depth and submodule recurse --- appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 98e0d1a3f97..30b956ab397 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,8 +56,6 @@ init: Set-AppveyorBuildVariable "versionType" $versionType } -clone_depth: 1 - install: - cd appveyor # Decrypt files. @@ -186,7 +184,7 @@ test_script: # resulting from the pr branch being merged into its base branch. # Therefore to create a diff for linting, we must fetch the head of the base branch. # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. - git fetch -q origin $env:APPVEYOR_REPO_BRANCH + git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH $flake8Output = "$lintOutput\PR-Flake8.txt" .\runlint.bat FETCH_HEAD "$flake8Output" if($LastExitCode -ne 0) { From bfa74ee0cf36c5bfaa21a1913e083ae513cb8887 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 16:26:52 +1000 Subject: [PATCH 2/7] add try branch builds linting --- appveyor.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 30b956ab397..6f1c5fea35f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -176,20 +176,30 @@ test_script: # Flake8 Linting - ps: | - if($env:APPVEYOR_PULL_REQUEST_NUMBER) { $lintOutput = (Resolve-Path .\testOutput\lint\) $lintSource = (Resolve-Path .\tests\lint\) + $flake8Output = "$lintOutput\Flake8.txt" # When Appveyor runs for a pr, # the build is made from a new temporary commit, # resulting from the pr branch being merged into its base branch. # Therefore to create a diff for linting, we must fetch the head of the base branch. # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. - git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH - $flake8Output = "$lintOutput\PR-Flake8.txt" - .\runlint.bat FETCH_HEAD "$flake8Output" - if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "PR introduces Flake8 errors" + # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. + if($env:APPVEYOR_PULL_REQUEST_NUMBER) { + git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH + .\runlint.bat FETCH_HEAD "$flake8Output" + if($LastExitCode -ne 0) { + $errorCode=$LastExitCode + Add-AppveyorMessage "PR introduces Flake8 errors" + } + } else { + # However in a pushed branch, we must fetch master. + git fetch -q --recurse-submodules=on-demand origin master:master + .\runlint.bat FETCH_HEAD $flake8Output + if($LastExitCode -ne 0) { + $errorCode=$LastExitCode + Add-AppveyorMessage "Branch introduces Flake8 errors" + } } Push-AppveyorArtifact $flake8Output $junitXML = "$lintOutput\PR-Flake8.xml" @@ -198,7 +208,6 @@ test_script: $wc = New-Object 'System.Net.WebClient' $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $junitXML) if($errorCode -ne 0) { $host.SetShouldExit($errorCode) } - } # System tests - ps: | From e46970ea4a1fdb887c6722a642bc678f0c8ee038 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 16:26:52 +1000 Subject: [PATCH 3/7] add try branch builds linting --- appveyor.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 30b956ab397..dff09018275 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -176,20 +176,30 @@ test_script: # Flake8 Linting - ps: | - if($env:APPVEYOR_PULL_REQUEST_NUMBER) { $lintOutput = (Resolve-Path .\testOutput\lint\) $lintSource = (Resolve-Path .\tests\lint\) + $flake8Output = "$lintOutput\Flake8.txt" # When Appveyor runs for a pr, # the build is made from a new temporary commit, # resulting from the pr branch being merged into its base branch. # Therefore to create a diff for linting, we must fetch the head of the base branch. # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. - git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH - $flake8Output = "$lintOutput\PR-Flake8.txt" - .\runlint.bat FETCH_HEAD "$flake8Output" - if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "PR introduces Flake8 errors" + # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. + if($env:APPVEYOR_PULL_REQUEST_NUMBER) { + git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH + .\runlint.bat FETCH_HEAD "$flake8Output" + if($LastExitCode -ne 0) { + $errorCode=$LastExitCode + Add-AppveyorMessage "PR introduces Flake8 errors" + } + } else { + # However in a pushed branch, we must fetch master. + git fetch -q --recurse-submodules=on-demand origin master:master + .\runlint.bat FETCH_HEAD $flake8Output + if($LastExitCode -ne 0) { + $errorCode=$LastExitCode + Add-AppveyorMessage "Branch introduces Flake8 errors" + } } Push-AppveyorArtifact $flake8Output $junitXML = "$lintOutput\PR-Flake8.xml" @@ -198,7 +208,6 @@ test_script: $wc = New-Object 'System.Net.WebClient' $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $junitXML) if($errorCode -ne 0) { $host.SetShouldExit($errorCode) } - } # System tests - ps: | From ffefb320eaf5874502689eb6865b746638ca8f27 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 17:06:34 +1000 Subject: [PATCH 4/7] remove unsupported 'on-demand' --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index dff09018275..ce59264bc87 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -186,7 +186,7 @@ test_script: # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. if($env:APPVEYOR_PULL_REQUEST_NUMBER) { - git fetch -q --recurse-submodules=on-demand origin $env:APPVEYOR_REPO_BRANCH + git fetch -q --recurse-submodules origin $env:APPVEYOR_REPO_BRANCH .\runlint.bat FETCH_HEAD "$flake8Output" if($LastExitCode -ne 0) { $errorCode=$LastExitCode @@ -194,7 +194,7 @@ test_script: } } else { # However in a pushed branch, we must fetch master. - git fetch -q --recurse-submodules=on-demand origin master:master + git fetch -q --recurse-submodules origin master:master .\runlint.bat FETCH_HEAD $flake8Output if($LastExitCode -ne 0) { $errorCode=$LastExitCode From 3e474cdf1e228a0e2c3e9e72dc0a1aec98485f66 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 17:08:02 +1000 Subject: [PATCH 5/7] fix formatting --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ce59264bc87..3608d8204e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -189,16 +189,16 @@ test_script: git fetch -q --recurse-submodules origin $env:APPVEYOR_REPO_BRANCH .\runlint.bat FETCH_HEAD "$flake8Output" if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "PR introduces Flake8 errors" + $errorCode=$LastExitCode + Add-AppveyorMessage "PR introduces Flake8 errors" } } else { # However in a pushed branch, we must fetch master. git fetch -q --recurse-submodules origin master:master .\runlint.bat FETCH_HEAD $flake8Output if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "Branch introduces Flake8 errors" + $errorCode=$LastExitCode + Add-AppveyorMessage "Branch introduces Flake8 errors" } } Push-AppveyorArtifact $flake8Output From dc79df1a976b52c47a7c62c0fcd23b3a99d78728 Mon Sep 17 00:00:00 2001 From: buddsean Date: Tue, 27 Apr 2021 17:12:33 +1000 Subject: [PATCH 6/7] apply DRY --- appveyor.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3608d8204e3..fffbe8a6b82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -187,19 +187,16 @@ test_script: # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. if($env:APPVEYOR_PULL_REQUEST_NUMBER) { git fetch -q --recurse-submodules origin $env:APPVEYOR_REPO_BRANCH - .\runlint.bat FETCH_HEAD "$flake8Output" - if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "PR introduces Flake8 errors" - } + $msgBaseLabel = "PR" } else { # However in a pushed branch, we must fetch master. git fetch -q --recurse-submodules origin master:master - .\runlint.bat FETCH_HEAD $flake8Output - if($LastExitCode -ne 0) { - $errorCode=$LastExitCode - Add-AppveyorMessage "Branch introduces Flake8 errors" - } + $msgBaseLabel = "Branch" + } + .\runlint.bat FETCH_HEAD "$flake8Output" + if($LastExitCode -ne 0) { + $errorCode=$LastExitCode + Add-AppveyorMessage "$msgBaseLabel introduces Flake8 errors" } Push-AppveyorArtifact $flake8Output $junitXML = "$lintOutput\PR-Flake8.xml" From a4b63af0389c95510e298b14ed575196fcb131b7 Mon Sep 17 00:00:00 2001 From: buddsean Date: Wed, 28 Apr 2021 12:23:14 +1000 Subject: [PATCH 7/7] remove recurse-submodules --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fffbe8a6b82..4065e1b4f04 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -186,11 +186,11 @@ test_script: # In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch. # Additionally, we can not use a clone_depth of 1, but must use an unlimited clone. if($env:APPVEYOR_PULL_REQUEST_NUMBER) { - git fetch -q --recurse-submodules origin $env:APPVEYOR_REPO_BRANCH + git fetch -q origin $env:APPVEYOR_REPO_BRANCH $msgBaseLabel = "PR" } else { # However in a pushed branch, we must fetch master. - git fetch -q --recurse-submodules origin master:master + git fetch -q origin master:master $msgBaseLabel = "Branch" } .\runlint.bat FETCH_HEAD "$flake8Output"