Move Windows and Linux CI to VSTS (#566)
* Remove Windows and Linux configurations from netci.groovy * Add end of line to yml files * Add badges and change leg name to Linux * Not merge test results * Add searchFolder to publish test results task
This commit is contained in:
Родитель
8c11759ea8
Коммит
a862ccc5a8
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
32
netci.groovy
32
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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче