diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml new file mode 100644 index 000000000..80ed1b4ac --- /dev/null +++ b/.vsts-dotnet-ci.yml @@ -0,0 +1,21 @@ +resources: + containers: + - container: centos7 + image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416 + +phases: +- template: /build/ci/phase-template.yml + parameters: + name: Linux + buildScript: ./build.sh + queue: + container: centos7 + +- template: /build/ci/phase-template.yml + parameters: + name: Windows_NT + buildScript: build.cmd + queue: + name: Hosted VS2017 + demands: + - agent.os -equals Windows_NT diff --git a/README.md b/README.md index d20d3f73c..9ccd06c16 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc | | x64 Debug | x64 Release | |:---|----------------:|------------------:| -|**Linux**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/lastCompletedBuild)| +|**Linux**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| |**macOS**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/lastCompletedBuild)| -|**Windows**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/lastCompletedBuild)| +|**Windows**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| ## Contributing diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml new file mode 100644 index 000000000..2c8430465 --- /dev/null +++ b/build/ci/phase-template.yml @@ -0,0 +1,33 @@ +parameters: + name: '' + buildScript: '' + queue: {} + +phases: + - phase: ${{ parameters.name }} + variables: + _buildScript: ${{ parameters.buildScript }} + _phaseName: ${{ parameters.name }} + queue: + parallel: 2 + matrix: + Build_Debug: + _configuration: Debug + Build_Release: + _configuration: Release + ${{ insert }}: ${{ parameters.queue }} + steps: + - script: $(_buildScript) -$(_configuration) -runtests + displayName: Build and Test + - task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + inputs: + testRunner: 'vSTest' + searchFolder: '$(System.DefaultWorkingDirectory)/bin' + testResultsFiles: '**/*.trx' + testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber) + configuration: $(_configuration) + mergeTestResults: true + - script: $(_buildScript) -buildPackages + displayName: Build Packages diff --git a/netci.groovy b/netci.groovy index eb78c766a..b955bf669 100644 --- a/netci.groovy +++ b/netci.groovy @@ -6,46 +6,22 @@ import jobs.generation.Utilities; def project = GithubProject def branch = GithubBranchName -['Windows_NT', 'Linux', 'OSX10.13'].each { os -> +['OSX10.13'].each { os -> ['Debug', 'Release'].each { config -> [true, false].each { isPR -> // Calculate job name def jobName = os.toLowerCase() + '_' + config.toLowerCase() - def buildFile = ''; def machineAffinity = 'latest-or-auto' - // Calculate the build command - if (os == 'Windows_NT') { - buildFile = ".\\build.cmd" - } else { - buildFile = "./build.sh" - } - - def buildCommand = buildFile + " -$config -runtests" - def packCommand = buildFile + " -buildPackages" - def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { steps { - if (os == 'Windows_NT') { - batchFile(buildCommand) - batchFile(packCommand) - } - else { - // Shell - shell(buildCommand) - shell(packCommand) - } + shell("./build.sh -$config -runtests") + shell("./build.sh -buildPackages") } } - def osImageName = os - if (os == 'Linux') { - // Trigger a portable Linux build that runs on RHEL7.2 - osImageName = "RHEL7.2" - } - - Utilities.setMachineAffinity(newJob, osImageName, machineAffinity) + Utilities.setMachineAffinity(newJob, os, machineAffinity) Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") if (isPR) {