From f522f5e64859eda8aaf8ed3b2fd59c1a69624fce Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 9 Aug 2019 17:54:11 -0700 Subject: [PATCH] CI Improvements (#109) * Changing the package output path so all packages go to the same folder. * Explicitly setting the repo to use 3.0.100-preview7-012821 rather than latest * Reducing the azure-pipelines file size by using templates * Updating the azure-pipelines to collection package artifacts * Setting RuntimeIdentifier for ubuntu again. --- Directory.Build.props | 2 +- scripts/azure-pipelines.yml | 134 ++++++++++++++---------------------- scripts/azure-unix.yml | 29 ++++++++ scripts/azure-windows.yml | 27 ++++++++ scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- 6 files changed, 109 insertions(+), 87 deletions(-) create mode 100644 scripts/azure-unix.yml create mode 100644 scripts/azure-windows.yml diff --git a/Directory.Build.props b/Directory.Build.props index f48f26eb..44513e0e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -38,7 +38,7 @@ Microsoft and Contributors $(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/ Microsoft - $(BaseArtifactsPath)pkg/$(BaseArtifactsPathSuffix)/$(Configuration)/ + $(BaseArtifactsPath)pkg/$(Configuration)/ LLVMSharp 8.0.0 alpha diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml index 6c068d73..e992b9af 100644 --- a/scripts/azure-pipelines.yml +++ b/scripts/azure-pipelines.yml @@ -5,94 +5,60 @@ pr: - master jobs: -- job: windows_debug_x86 - pool: - name: Hosted - demands: Cmd - steps: - - task: BatchScript@1 - displayName: 'Run scripts/cibuild.cmd' - inputs: - filename: scripts/cibuild.cmd - arguments: '-configuration Debug -architecture x86' +- template: azure-windows.yml + parameters: + name: windows_debug_x86 + pool: Hosted + configuration: Debug + architecture: x86 -- job: windows_release_x86 - pool: - name: Hosted - demands: Cmd - steps: - - task: BatchScript@1 - displayName: 'Run scripts/cibuild.cmd' - inputs: - filename: scripts/cibuild.cmd - arguments: '-configuration Release -architecture x86' +- template: azure-windows.yml + parameters: + name: windows_release_x86 + pool: Hosted + configuration: Release + architecture: x86 -- job: windows_debug_x64 - pool: - name: Hosted - demands: Cmd - steps: - - task: BatchScript@1 - displayName: 'Run scripts/cibuild.cmd' - inputs: - filename: scripts/cibuild.cmd - arguments: '-configuration Debug -architecture x64' +- template: azure-windows.yml + parameters: + name: windows_debug_x64 + pool: Hosted + configuration: Debug + architecture: x64 -- job: windows_release_x64 - pool: - name: Hosted - demands: Cmd - steps: - - task: BatchScript@1 - displayName: 'Run scripts/cibuild.cmd' - inputs: - filename: scripts/cibuild.cmd - arguments: '-configuration Release -architecture x64' +- template: azure-windows.yml + parameters: + name: windows_release_x64 + pool: Hosted + configuration: Release + architecture: x64 -- job: ubuntu_1604_debug_x64 - pool: - name: Hosted Ubuntu 1604 - variables: - RuntimeIdentifier: ubuntu.16.04-x64 - steps: - - task: Bash@3 - displayName: 'Run scripts/cibuild.sh' - inputs: - targetType: filePath - filePath: ./scripts/cibuild.sh - arguments: '--configuration Debug --architecture x64' +- template: azure-unix.yml + parameters: + name: ubuntu_debug_x64 + pool: Hosted Ubuntu 1604 + configuration: Debug + architecture: x64 + rid: ubuntu.16.04-x64 -- job: ubuntu_1604_release_x64 - pool: - name: Hosted Ubuntu 1604 - variables: - RuntimeIdentifier: ubuntu.16.04-x64 - steps: - - task: Bash@3 - displayName: 'Run scripts/cibuild.sh' - inputs: - targetType: filePath - filePath: ./scripts/cibuild.sh - arguments: '--configuration Release --architecture x64' +- template: azure-unix.yml + parameters: + name: ubuntu_release_x64 + pool: Hosted Ubuntu 1604 + configuration: Release + architecture: x64 + rid: ubuntu.16.04-x64 -- job: macos_1014_debug_x64 - pool: - name: Hosted macOS - steps: - - task: Bash@3 - displayName: 'Run scripts/cibuild.sh' - inputs: - targetType: filePath - filePath: ./scripts/cibuild.sh - arguments: '--configuration Debug --architecture x64' +- template: azure-unix.yml + parameters: + name: macos_debug_x64 + pool: Hosted macOS + configuration: Debug + architecture: x64 -- job: macos_1014_release_x64 - pool: - name: Hosted macOS - steps: - - task: Bash@3 - displayName: 'Run scripts/cibuild.sh' - inputs: - targetType: filePath - filePath: ./scripts/cibuild.sh - arguments: '--configuration Release --architecture x64' +- template: azure-unix.yml + parameters: + name: macos_release_x64 + pool: Hosted macOS + configuration: Release + architecture: x64 diff --git a/scripts/azure-unix.yml b/scripts/azure-unix.yml new file mode 100644 index 00000000..e7af273c --- /dev/null +++ b/scripts/azure-unix.yml @@ -0,0 +1,29 @@ +jobs: +- job: ${{parameters.name}} + pool: + name: ${{parameters.pool}} + steps: + - task: Bash@3 + displayName: 'Run scripts/cibuild.sh' + inputs: + targetType: filePath + filePath: ./scripts/cibuild.sh + arguments: '--configuration ${{parameters.configuration}} --architecture ${{parameters.architecture}}' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: VSTest + testResultsFiles: artifacts/tst/${{parameters.configuration}}/*.trx + mergeTestResults: true + failTaskOnFailedTests: true + testRunTitle: '${{parameters.name}}' + buildConfiguration: ${{parameters.configuration}} + buildPlatform: ${{parameters.architecture}} + - task: PublishBuildArtifacts@1 + displayName: 'Publish NuGet Packages' + inputs: + PathtoPublish: artifacts/pkg/${{parameters.configuration}} + ArtifactName: packages + publishLocation: Container + variables: + RuntimeIdentifier: ${{parameters.rid}} diff --git a/scripts/azure-windows.yml b/scripts/azure-windows.yml new file mode 100644 index 00000000..3c369ba7 --- /dev/null +++ b/scripts/azure-windows.yml @@ -0,0 +1,27 @@ +jobs: +- job: ${{parameters.name}} + pool: + name: ${{parameters.pool}} + demands: Cmd + steps: + - task: BatchScript@1 + displayName: 'Run scripts/cibuild.cmd' + inputs: + filename: scripts/cibuild.cmd + arguments: '-configuration ${{parameters.configuration}} -architecture ${{parameters.architecture}}' + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: VSTest + testResultsFiles: artifacts/tst/${{parameters.configuration}}/*.trx + mergeTestResults: true + failTaskOnFailedTests: true + testRunTitle: '${{parameters.name}}' + buildConfiguration: ${{parameters.configuration}} + buildPlatform: ${{parameters.architecture}} + - task: PublishBuildArtifacts@1 + displayName: 'Publish NuGet Packages' + inputs: + PathtoPublish: artifacts/pkg/${{parameters.configuration}} + ArtifactName: packages + publishLocation: Container diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 4580fa9c..898d7bfd 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -120,7 +120,7 @@ try { $DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet" Create-Directory -Path $DotNetInstallDirectory - & $DotNetInstallScript -Channel release/3.0.1xx -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture + & $DotNetInstallScript -Channel release/3.0.1xx -Version 3.0.100-preview7-012821 -InstallDir $DotNetInstallDirectory -Architecture $architecture & $DotNetInstallScript -Channel 2.1 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet & $DotNetInstallScript -Channel 2.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet diff --git a/scripts/build.sh b/scripts/build.sh index 6086d29b..25ffc5ab 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -204,7 +204,7 @@ if [[ ! -z "$architecture" ]]; then DotNetInstallDirectory="$ArtifactsDir/dotnet" CreateDirectory "$DotNetInstallDirectory" - . "$DotNetInstallScript" --channel release/3.0.1xx --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" + . "$DotNetInstallScript" --channel release/3.0.1xx --version 3.0.100-preview7-012821 --install-dir "$DotNetInstallDirectory" --architecture "$architecture" . "$DotNetInstallScript" --channel 2.1 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet . "$DotNetInstallScript" --channel 2.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet