forked from microsoft/LightGBM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vsts-ci.yml
156 lines (155 loc) · 4.98 KB
/
.vsts-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
variables:
PYTHON_VERSION: 3.7
CONDA_ENV: test-env
phases:
###########################################
- phase: Linux
###########################################
variables:
COMPILER: gcc
queue:
name: 'Hosted Linux Preview'
parallel: 6
matrix:
regular:
TASK: regular
sdist:
TASK: sdist
PYTHON_VERSION: 3.5
bdist:
TASK: bdist
PYTHON_VERSION: 3.6
inference:
TASK: if-else
mpi_source:
TASK: mpi
METHOD: source
PYTHON_VERSION: 2.7
gpu_source:
TASK: gpu
METHOD: source
PYTHON_VERSION: 3.6
steps:
- task: CondaEnvironment@0
inputs:
updateConda: true
environmentName: $(CONDA_ENV)
packageSpecs: 'python=$(PYTHON_VERSION)'
createOptions: '-q'
- script: |
echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
AMDAPPSDK_PATH=$AGENT_HOMEDIRECTORY/AMDAPPSDK
echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH"
LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH"
echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors"
chmod +x $BUILD_SOURCESDIRECTORY/.vsts-ci/setup.sh
chmod +x $BUILD_SOURCESDIRECTORY/.vsts-ci/test.sh
displayName: 'Set variables'
- bash: $(Build.SourcesDirectory)/.vsts-ci/setup.sh
displayName: Setup
- bash: $(Build.SourcesDirectory)/.vsts-ci/test.sh
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
artifactType: container
###########################################
- phase: MacOS
###########################################
queue:
name: 'Hosted macOS Preview'
parallel: 3
matrix:
regular:
TASK: regular
PYTHON_VERSION: 2.7
sdist:
TASK: sdist
PYTHON_VERSION: 3.4
bdist:
TASK: bdist
PYTHON_VERSION: 3.5
steps:
- script: |
brew install libomp
brew reinstall cmake
wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
bash conda.sh -b -p $HOME/miniconda
export PATH=$HOME/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda create -q -n $CONDA_ENV python=$PYTHON_VERSION
source activate $CONDA_ENV
export LGB_VER=$(head -n 1 VERSION.txt)
bash .vsts-ci/test.sh
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
artifactType: container
###########################################
- phase: Windows
###########################################
queue:
name: 'Hosted VS2017'
parallel: 3
matrix:
regular:
TASK: regular
PYTHON_VERSION: 3.5
sdist:
TASK: sdist
PYTHON_VERSION: 2.7
bdist:
TASK: bdist
PYTHON_VERSION: 3.6
steps:
- task: CondaEnvironment@0
inputs:
updateConda: true
environmentName: $(CONDA_ENV)
packageSpecs: 'python=$(PYTHON_VERSION) numpy nose scipy scikit-learn pandas matplotlib python-graphviz pytest'
createOptions: '-q'
- powershell: $(Build.SourcesDirectory)/.vsts-ci/test_windows.ps1
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
artifactType: container
###########################################
- phase: Package
###########################################
dependsOn:
- Linux
- MacOS
- Windows
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
queue:
name: 'Hosted VS2017'
steps:
# Download all agent packages from all previous phases
- task: DownloadBuildArtifacts@0
displayName: Download package assets
inputs:
artifactName: PackageAssets
downloadPath: $(Build.SourcesDirectory)/binaries
- powershell: |
$client = new-object System.Net.WebClient
$client.DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", "$(Build.SourcesDirectory)/.nuget/nuget.exe")
displayName: 'Download NuGet application'
- script: |
cd %BUILD_SOURCESDIRECTORY%/.nuget
python create_nuget.py %BUILD_SOURCESDIRECTORY%/binaries/PackageAssets
nuget.exe pack LightGBM.nuspec
xcopy *.nupkg %BUILD_ARTIFACTSTAGINGDIRECTORY%
displayName: 'Build NuGet package'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: Nuget
artifactType: container