From cf9d6b5dd5f9c361edfdef1f66405513b6bc523e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 1 Apr 2019 16:58:43 -0700 Subject: [PATCH] Fix publishing daily nupkg to MyGet (#9269) # Conflicts: # .vsts-ci/windows.yml --- .vsts-ci/linux.yml | 31 ++------- .vsts-ci/mac.yml | 31 ++------- .vsts-ci/templates/verify-xunit.yml | 33 +++++++++ .vsts-ci/templates/windows-packaging.yml | 1 + .vsts-ci/windows-daily.yml | 85 ++++++++++++++++++++++++ .vsts-ci/windows.yml | 34 ++-------- 6 files changed, 134 insertions(+), 81 deletions(-) create mode 100644 .vsts-ci/templates/verify-xunit.yml create mode 100644 .vsts-ci/windows-daily.yml diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 4521df9e54..c77923ba1a 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -75,30 +75,7 @@ jobs: parentJobs: - linux_build -- job: verify_xunit - displayName: Verify xUnit Results - pool: - name: Hosted Ubuntu 1604 - dependsOn: - - linux_build - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download build artifacts' - inputs: - downloadType: specific - itemPattern: | - xunit/**/* - downloadPath: '$(System.ArtifactsDirectory)' - - - pwsh: | - Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse - displayName: 'Capture artifacts directory' - continueOnError: true - - - pwsh: | - Import-Module .\tools\ci.psm1 - $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" - - Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile - displayName: Test - condition: succeeded() +- template: templates/verify-xunit.yml + parameters: + pool: Hosted Ubuntu 1604 + dependsOn: linux_build diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index 579cd5be95..56c4c6f27a 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -69,30 +69,7 @@ jobs: parentJobs: - mac_build -- job: verify_xunit - displayName: Verify xUnit Results - pool: - name: 'Hosted macOS' - dependsOn: - - mac_build - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download build artifacts' - inputs: - downloadType: specific - itemPattern: | - xunit/**/* - downloadPath: '$(System.ArtifactsDirectory)' - - - pwsh: | - Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse - displayName: 'Capture artifacts directory' - continueOnError: true - - - pwsh: | - Import-Module .\tools\ci.psm1 - $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" - - Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile - displayName: Test - condition: succeeded() +- template: templates/verify-xunit.yml + parameters: + pool: 'Hosted macOS' + dependsOn: mac_build diff --git a/.vsts-ci/templates/verify-xunit.yml b/.vsts-ci/templates/verify-xunit.yml new file mode 100644 index 0000000000..b6bf2748ab --- /dev/null +++ b/.vsts-ci/templates/verify-xunit.yml @@ -0,0 +1,33 @@ +parameters: + dependsOn: 'win_build' + pool: 'Hosted VS2017' + jobName: 'xunit_verify' + +jobs: +- job: verify_xunit + displayName: Verify xUnit Results + pool: + name: ${{ parameters.pool }} + dependsOn: + - ${{ parameters.dependsOn }} + steps: + - task: DownloadBuildArtifacts@0 + displayName: 'Download build artifacts' + inputs: + downloadType: specific + itemPattern: | + xunit/**/* + downloadPath: '$(System.ArtifactsDirectory)' + + - powershell: | + dir "$(System.ArtifactsDirectory)\*" -Recurse + displayName: 'Capture artifacts directory' + continueOnError: true + + - powershell: | + Import-Module .\tools\ci.psm1 + $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" + + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + displayName: Test + condition: succeeded() diff --git a/.vsts-ci/templates/windows-packaging.yml b/.vsts-ci/templates/windows-packaging.yml index 3f03323cc3..30f89fc5b8 100644 --- a/.vsts-ci/templates/windows-packaging.yml +++ b/.vsts-ci/templates/windows-packaging.yml @@ -1,6 +1,7 @@ parameters: pool: 'Hosted VS2017' jobName: 'win_packaging' + parentJobs: [] jobs: - job: ${{ parameters.jobName }} diff --git a/.vsts-ci/windows-daily.yml b/.vsts-ci/windows-daily.yml new file mode 100644 index 0000000000..026190c132 --- /dev/null +++ b/.vsts-ci/windows-daily.yml @@ -0,0 +1,85 @@ +name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) +trigger: + # Batch merge builds together while a merge build is running + batch: true + branches: + include: + - master + - release* + paths: + include: + - '*' + exclude: + - /tools/releaseBuild/**/* + - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* +pr: + branches: + include: + - master + - release* + paths: + include: + - '*' + exclude: + - /tools/releaseBuild/**/* + - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* + +variables: + GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + +resources: +- repo: self + clean: true + +jobs: +- template: templates/ci-build.yml + +- template: templates/windows-test.yml + parameters: + purpose: UnelevatedPesterTests + tagSet: CI + parentJobs: + - win_build + +- template: templates/windows-test.yml + parameters: + purpose: ElevatedPesterTests + tagSet: CI + parentJobs: + - win_build + +- template: templates/windows-test.yml + parameters: + purpose: UnelevatedPesterTests + tagSet: Others + parentJobs: + - win_build + +- template: templates/windows-test.yml + parameters: + purpose: ElevatedPesterTests + tagSet: Others + parentJobs: + - win_build + +- template: templates/windows-packaging.yml + parameters: + # we wait for all tests to finish as this phase uploads the daily nuget package to MyGet. + # we want to upload only if tests have passed. + dependsOn: + - win_test_UnelevatedPesterTests_CI + - win_test_ElevatedPesterTests_CI + - win_test_UnelevatedPesterTests_Others + - win_test_ElevatedPesterTests_Others + - verify_xunit + +- template: templates/verify-xunit.yml + parameters: + pool: 'Hosted VS2017' + dependsOn: win_build diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index 055138da1b..76e727b489 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -12,6 +12,7 @@ trigger: exclude: - /tools/releaseBuild/**/* - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* pr: branches: include: @@ -23,6 +24,7 @@ pr: exclude: - /tools/releaseBuild/**/* - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* variables: GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'" @@ -66,32 +68,10 @@ jobs: parentJobs: - win_build +# Unlike daily builds, we do not upload nuget package to MyGet so we do not wait on tests to finish. - template: templates/windows-packaging.yml -- job: verify_xunit - displayName: Verify xUnit Results - pool: - name: 'Hosted VS2017' - dependsOn: - - win_build - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download build artifacts' - inputs: - downloadType: specific - itemPattern: | - xunit/**/* - downloadPath: '$(System.ArtifactsDirectory)' - - - powershell: | - dir "$(System.ArtifactsDirectory)\*" -Recurse - displayName: 'Capture artifacts directory' - continueOnError: true - - - powershell: | - Import-Module .\tools\ci.psm1 - $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" - - Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile - displayName: Test - condition: succeeded() +- template: templates/verify-xunit.yml + parameters: + pool: 'Hosted VS2017' + dependsOn: win_build