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

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