.vsts-ci.yml 6.23 KB
Newer Older
1
variables:
2
  PYTHON_VERSION: 3.7
3
  CONDA_ENV: test-env
4
5
6
7
resources:
  containers:
  - container: ubuntu1404
    image: lightgbm/vsts-agent:ubuntu-14.04
8
jobs:
Guolin Ke's avatar
Guolin Ke committed
9
###########################################
10
- job: Linux
Guolin Ke's avatar
Guolin Ke committed
11
###########################################
12
13
  variables:
    COMPILER: gcc
14
15
  pool:
    vmImage: 'ubuntu-16.04'
16
  container: ubuntu1404
17
  strategy:
18
    maxParallel: 5
Guolin Ke's avatar
Guolin Ke committed
19
20
21
22
23
    matrix:
      regular:
        TASK: regular
      sdist:
        TASK: sdist
24
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
25
26
      bdist:
        TASK: bdist
27
28
29
30
31
32
33
        PYTHON_VERSION: 3.6
      inference:
        TASK: if-else
      mpi_source:
        TASK: mpi
        METHOD: source
        PYTHON_VERSION: 2.7
34
35
36
37
38
39
40
  steps:
  - script: |
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
Nikita Titov's avatar
Nikita Titov committed
41
      echo "##vso[task.prependpath]$CONDA/bin"
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    displayName: 'Set variables'
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
    displayName: Setup
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
    displayName: Test
  - task: PublishBuildArtifacts@1
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
      artifactName: PackageAssets
      artifactType: container
###########################################
- job: Linux_gpu
###########################################
  variables:
    COMPILER: gcc
  pool:
    vmImage: 'ubuntu-16.04'
  strategy:
    maxParallel: 1
    matrix:
63
64
      gpu_source:
        TASK: gpu
Guolin Ke's avatar
Guolin Ke committed
65
        METHOD: source
66
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
67
  steps:
68
  - script: |
69
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
70
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
71
72
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
73
74
75
76
77
78
      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"
Nikita Titov's avatar
Nikita Titov committed
79
80
81
      CONDA=$AGENT_HOMEDIRECTORY/miniconda
      echo "##vso[task.setvariable variable=CONDA]$CONDA"
      echo "##vso[task.prependpath]$CONDA/bin"
82
    displayName: 'Set variables'
83
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
84
    displayName: Setup
85
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
86
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
87
###########################################
88
- job: MacOS
Guolin Ke's avatar
Guolin Ke committed
89
###########################################
90
  variables:
91
    COMPILER: clang
92
93
94
95
  pool:
    vmImage: 'macOS-10.13'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
96
97
98
    matrix:
      regular:
        TASK: regular
99
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
100
101
      sdist:
        TASK: sdist
102
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
103
104
105
      bdist:
        TASK: bdist
  steps:
106
  - script: |
107
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
108
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
109
110
      echo "##vso[task.setvariable variable=OS_NAME]macos"
      echo "##vso[task.setvariable variable=AZURE]true"
111
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
Nikita Titov's avatar
Nikita Titov committed
112
113
114
      CONDA=$AGENT_HOMEDIRECTORY/miniconda
      echo "##vso[task.setvariable variable=CONDA]$CONDA"
      echo "##vso[task.prependpath]$CONDA/bin"
115
    displayName: 'Set variables'
116
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
117
    displayName: Setup
118
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
119
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
120
  - task: PublishBuildArtifacts@1
121
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
122
123
124
125
126
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
      artifactName: PackageAssets
      artifactType: container
###########################################
127
- job: Windows
Guolin Ke's avatar
Guolin Ke committed
128
###########################################
129
130
131
132
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
133
134
135
    matrix:
      regular:
        TASK: regular
136
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
137
138
139
140
141
      sdist:
        TASK: sdist
        PYTHON_VERSION: 2.7
      bdist:
        TASK: bdist
142
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
143
  steps:
Nikita Titov's avatar
Nikita Titov committed
144
145
146
147
148
149
  - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
    displayName: Enable conda
  - script: |
      conda update -q -y conda
      conda create -q -y -n %CONDA_ENV% python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
      cmd /c "activate %CONDA_ENV% & powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1"
150
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
151
  - task: PublishBuildArtifacts@1
152
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
153
    inputs:
154
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
155
156
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
157

158
###########################################
159
- job: Package
160
###########################################
Guolin Ke's avatar
Guolin Ke committed
161
162
163
164
  dependsOn:
  - Linux
  - MacOS
  - Windows
165
  condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
166
167
  pool:
    vmImage: 'vs2017-win2016'
Guolin Ke's avatar
Guolin Ke committed
168
169
170
171
172
173
174
175
  steps:
  # Download all agent packages from all previous phases
  - task: DownloadBuildArtifacts@0
    displayName: Download package assets
    inputs:
      artifactName: PackageAssets
      downloadPath: $(Build.SourcesDirectory)/binaries
  - script: |
176
177
178
179
180
181
182
      python %BUILD_SOURCESDIRECTORY%/.nuget/create_nuget.py %BUILD_SOURCESDIRECTORY%/binaries/PackageAssets
    displayName: 'Create NuGet configuration files'
  - task: NuGetCommand@2
    inputs:
      command: pack
      packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec'
      packDestination: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
183
184
  - task: PublishBuildArtifacts@1
    inputs:
185
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
186
      artifactName: NuGet
Guolin Ke's avatar
Guolin Ke committed
187
      artifactType: container