.vsts-ci.yml 5.48 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
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
41
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
42
43
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
44
45
46
47
48
49
50
      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"
    displayName: 'Set variables'
51
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
52
    displayName: Setup
53
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
54
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
55
  - task: PublishBuildArtifacts@1
56
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
57
    inputs:
58
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
59
60
61
62
63
      artifactName: PackageAssets
      artifactType: container
###########################################
- phase: MacOS
###########################################
64
  variables:
65
    COMPILER: clang
Guolin Ke's avatar
Guolin Ke committed
66
  queue:
67
    name: 'Hosted macOS'
Guolin Ke's avatar
Guolin Ke committed
68
69
70
71
    parallel: 3
    matrix:
      regular:
        TASK: regular
72
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
73
74
      sdist:
        TASK: sdist
75
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
76
77
78
79
      bdist:
        TASK: bdist
  steps:
  - script: |
80
81
82
83
84
85
86
87
88
      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: |
89
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
90
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
91
92
      echo "##vso[task.setvariable variable=OS_NAME]macos"
      echo "##vso[task.setvariable variable=AZURE]true"
93
94
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
    displayName: 'Set variables'
95
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
96
    displayName: Setup
97
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
98
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
99
  - task: PublishBuildArtifacts@1
100
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
101
102
103
104
105
106
107
108
109
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
      artifactName: PackageAssets
      artifactType: container
###########################################
- phase: Windows
###########################################
  queue:
    name: 'Hosted VS2017'
110
    parallel: 3
Guolin Ke's avatar
Guolin Ke committed
111
112
113
    matrix:
      regular:
        TASK: regular
114
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
115
116
117
118
119
      sdist:
        TASK: sdist
        PYTHON_VERSION: 2.7
      bdist:
        TASK: bdist
120
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
121
122
123
  steps:
  - task: CondaEnvironment@0
    inputs:
124
      updateConda: true
Guolin Ke's avatar
Guolin Ke committed
125
      environmentName: $(CONDA_ENV)
126
      packageSpecs: 'python=$(PYTHON_VERSION) numpy nose scipy scikit-learn pandas matplotlib python-graphviz pytest'
Guolin Ke's avatar
Guolin Ke committed
127
      createOptions: '-q'
128
  - powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
129
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
130
  - task: PublishBuildArtifacts@1
131
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
132
    inputs:
133
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
134
135
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
136

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