Skip to content

Commit a862ccc

Browse files
safernIvanidzo4ka
authored andcommitted
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
1 parent 8c11759 commit a862ccc

File tree

4 files changed

+60
-30
lines changed

4 files changed

+60
-30
lines changed

.vsts-dotnet-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resources:
2+
containers:
3+
- container: centos7
4+
image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
5+
6+
phases:
7+
- template: /build/ci/phase-template.yml
8+
parameters:
9+
name: Linux
10+
buildScript: ./build.sh
11+
queue:
12+
container: centos7
13+
14+
- template: /build/ci/phase-template.yml
15+
parameters:
16+
name: Windows_NT
17+
buildScript: build.cmd
18+
queue:
19+
name: Hosted VS2017
20+
demands:
21+
- agent.os -equals Windows_NT

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc
4444

4545
| | x64 Debug | x64 Release |
4646
|:---|----------------:|------------------:|
47-
|**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)|
47+
|**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)|
4848
|**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)|
49-
|**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)|
49+
|**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)|
5050

5151
## Contributing
5252

build/ci/phase-template.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
name: ''
3+
buildScript: ''
4+
queue: {}
5+
6+
phases:
7+
- phase: ${{ parameters.name }}
8+
variables:
9+
_buildScript: ${{ parameters.buildScript }}
10+
_phaseName: ${{ parameters.name }}
11+
queue:
12+
parallel: 2
13+
matrix:
14+
Build_Debug:
15+
_configuration: Debug
16+
Build_Release:
17+
_configuration: Release
18+
${{ insert }}: ${{ parameters.queue }}
19+
steps:
20+
- script: $(_buildScript) -$(_configuration) -runtests
21+
displayName: Build and Test
22+
- task: PublishTestResults@2
23+
displayName: Publish Test Results
24+
condition: succeededOrFailed()
25+
inputs:
26+
testRunner: 'vSTest'
27+
searchFolder: '$(System.DefaultWorkingDirectory)/bin'
28+
testResultsFiles: '**/*.trx'
29+
testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber)
30+
configuration: $(_configuration)
31+
mergeTestResults: true
32+
- script: $(_buildScript) -buildPackages
33+
displayName: Build Packages

netci.groovy

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,22 @@ import jobs.generation.Utilities;
66
def project = GithubProject
77
def branch = GithubBranchName
88

9-
['Windows_NT', 'Linux', 'OSX10.13'].each { os ->
9+
['OSX10.13'].each { os ->
1010
['Debug', 'Release'].each { config ->
1111
[true, false].each { isPR ->
1212
// Calculate job name
1313
def jobName = os.toLowerCase() + '_' + config.toLowerCase()
14-
def buildFile = '';
1514

1615
def machineAffinity = 'latest-or-auto'
1716

18-
// Calculate the build command
19-
if (os == 'Windows_NT') {
20-
buildFile = ".\\build.cmd"
21-
} else {
22-
buildFile = "./build.sh"
23-
}
24-
25-
def buildCommand = buildFile + " -$config -runtests"
26-
def packCommand = buildFile + " -buildPackages"
27-
2817
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
2918
steps {
30-
if (os == 'Windows_NT') {
31-
batchFile(buildCommand)
32-
batchFile(packCommand)
33-
}
34-
else {
35-
// Shell
36-
shell(buildCommand)
37-
shell(packCommand)
38-
}
19+
shell("./build.sh -$config -runtests")
20+
shell("./build.sh -buildPackages")
3921
}
4022
}
4123

42-
def osImageName = os
43-
if (os == 'Linux') {
44-
// Trigger a portable Linux build that runs on RHEL7.2
45-
osImageName = "RHEL7.2"
46-
}
47-
48-
Utilities.setMachineAffinity(newJob, osImageName, machineAffinity)
24+
Utilities.setMachineAffinity(newJob, os, machineAffinity)
4925
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
5026

5127
if (isPR) {

0 commit comments

Comments
 (0)