.vsts-ci.yml 5.51 KB
Newer Older
1
variables:
2
  PYTHON_VERSION: 3.7
3
  CONDA_ENV: test-env
Guolin Ke's avatar
Guolin Ke committed
4
5
6
7
phases:
###########################################
- phase: Linux
###########################################
8
9
  variables:
    COMPILER: gcc
Guolin Ke's avatar
Guolin Ke committed
10
11
  queue:
    name: 'Hosted Linux Preview'
12
    parallel: 6
Guolin Ke's avatar
Guolin Ke committed
13
14
15
16
17
    matrix:
      regular:
        TASK: regular
      sdist:
        TASK: sdist
18
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
19
20
      bdist:
        TASK: bdist
21
22
23
24
25
26
27
28
29
        PYTHON_VERSION: 3.6
      inference:
        TASK: if-else
      mpi_source:
        TASK: mpi
        METHOD: source
        PYTHON_VERSION: 2.7
      gpu_source:
        TASK: gpu
Guolin Ke's avatar
Guolin Ke committed
30
        METHOD: source
31
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
32
33
34
  steps:
  - task: CondaEnvironment@0
    inputs:
35
      updateConda: true
Guolin Ke's avatar
Guolin Ke committed
36
      environmentName: $(CONDA_ENV)
37
      packageSpecs: 'python=$(PYTHON_VERSION)'
Guolin Ke's avatar
Guolin Ke committed
38
      createOptions: '-q'
39
  - script: |
40
41
42
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
43
44
45
46
47
48
      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"
49
50
      chmod +x $BUILD_SOURCESDIRECTORY/.ci/setup.sh
      chmod +x $BUILD_SOURCESDIRECTORY/.ci/test.sh
51
    displayName: 'Set variables'
52
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
53
    displayName: Setup
54
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
55
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
56
  - task: PublishBuildArtifacts@1
Guolin Ke's avatar
Guolin Ke committed
57
    condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Guolin Ke's avatar
Guolin Ke committed
58
    inputs:
59
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
60
61
62
63
64
      artifactName: PackageAssets
      artifactType: container
###########################################
- phase: MacOS
###########################################
65
66
  variables:
    COMPILER: gcc
Guolin Ke's avatar
Guolin Ke committed
67
68
69
70
71
72
  queue:
    name: 'Hosted macOS Preview'
    parallel: 3
    matrix:
      regular:
        TASK: regular
73
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
74
75
      sdist:
        TASK: sdist
76
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
77
78
79
80
      bdist:
        TASK: bdist
  steps:
  - script: |
81
82
83
84
85
86
87
88
89
      sudo chmod -R 777 /usr/local/miniconda/envs
    displayName: 'Fix for conda error on macOS'
  - task: CondaEnvironment@0
    inputs:
      updateConda: true
      environmentName: $(CONDA_ENV)
      packageSpecs: 'python=$(PYTHON_VERSION)'
      createOptions: '-q'
  - script: |
90
91
92
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
      echo "##vso[task.setvariable variable=OS_NAME]macos"
      echo "##vso[task.setvariable variable=AZURE]true"
93
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
94
95
      chmod +x $BUILD_SOURCESDIRECTORY/.ci/setup.sh
      chmod +x $BUILD_SOURCESDIRECTORY/.ci/test.sh
96
    displayName: 'Set variables'
97
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
98
    displayName: Setup
99
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
100
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
101
  - task: PublishBuildArtifacts@1
Guolin Ke's avatar
Guolin Ke committed
102
    condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Guolin Ke's avatar
Guolin Ke committed
103
104
105
106
107
108
109
110
111
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
      artifactName: PackageAssets
      artifactType: container
###########################################
- phase: Windows
###########################################
  queue:
    name: 'Hosted VS2017'
112
    parallel: 3
Guolin Ke's avatar
Guolin Ke committed
113
114
115
    matrix:
      regular:
        TASK: regular
116
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
117
118
119
120
121
      sdist:
        TASK: sdist
        PYTHON_VERSION: 2.7
      bdist:
        TASK: bdist
122
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
123
124
125
  steps:
  - task: CondaEnvironment@0
    inputs:
126
      updateConda: true
Guolin Ke's avatar
Guolin Ke committed
127
      environmentName: $(CONDA_ENV)
128
      packageSpecs: 'python=$(PYTHON_VERSION) numpy nose scipy scikit-learn pandas matplotlib python-graphviz pytest'
Guolin Ke's avatar
Guolin Ke committed
129
      createOptions: '-q'
130
  - powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
131
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
132
  - task: PublishBuildArtifacts@1
Guolin Ke's avatar
Guolin Ke committed
133
    condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Guolin Ke's avatar
Guolin Ke committed
134
    inputs:
135
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
136
137
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
138

139
###########################################
Guolin Ke's avatar
Guolin Ke committed
140
- phase: Package
141
###########################################
Guolin Ke's avatar
Guolin Ke committed
142
143
144
145
  dependsOn:
  - Linux
  - MacOS
  - Windows
Guolin Ke's avatar
Guolin Ke committed
146
  condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Guolin Ke's avatar
Guolin Ke committed
147
148
149
150
151
152
153
154
155
156
157
  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
158
159
      $client.DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", "$(Build.SourcesDirectory)/.nuget/nuget.exe")
    displayName: 'Download NuGet application'
Guolin Ke's avatar
Guolin Ke committed
160
  - script: |
161
      cd %BUILD_SOURCESDIRECTORY%/.nuget
Guolin Ke's avatar
Guolin Ke committed
162
163
164
      python create_nuget.py %BUILD_SOURCESDIRECTORY%/binaries/PackageAssets
      nuget.exe pack LightGBM.nuspec
      xcopy *.nupkg %BUILD_ARTIFACTSTAGINGDIRECTORY%
165
    displayName: 'Build NuGet package'
Guolin Ke's avatar
Guolin Ke committed
166
167
  - task: PublishBuildArtifacts@1
    inputs:
168
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
169
170
      artifactName: Nuget
      artifactType: container