.vsts-ci.yml 5.08 KB
Newer Older
1
variables:
2
  PYTHON_VERSION: 3.7
3
  CONDA_ENV: test-env
4
jobs:
Guolin Ke's avatar
Guolin Ke committed
5
###########################################
6
- job: Linux
Guolin Ke's avatar
Guolin Ke committed
7
###########################################
8
9
  variables:
    COMPILER: gcc
10
11
12
13
  pool:
    vmImage: 'ubuntu-16.04'
  strategy:
    maxParallel: 6
Guolin Ke's avatar
Guolin Ke committed
14
15
16
17
18
    matrix:
      regular:
        TASK: regular
      sdist:
        TASK: sdist
19
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
20
21
      bdist:
        TASK: bdist
22
23
24
25
26
27
28
29
30
        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
31
        METHOD: source
32
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
33
  steps:
34
  - task: CondaEnvironment@1
Guolin Ke's avatar
Guolin Ke committed
35
    inputs:
36
37
      updateConda: true
  - script: |
38
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
39
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
40
41
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
42
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"
    displayName: 'Set variables'
49
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
50
    displayName: Setup
51
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
52
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
53
  - task: PublishBuildArtifacts@1
54
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
55
    inputs:
56
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
57
58
59
      artifactName: PackageAssets
      artifactType: container
###########################################
60
- job: MacOS
Guolin Ke's avatar
Guolin Ke committed
61
###########################################
62
  variables:
63
    COMPILER: clang
64
65
66
67
  pool:
    vmImage: 'macOS-10.13'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
68
69
70
    matrix:
      regular:
        TASK: regular
71
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
72
73
      sdist:
        TASK: sdist
74
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
75
76
77
      bdist:
        TASK: bdist
  steps:
78
  - task: CondaEnvironment@1
79
80
81
    inputs:
      updateConda: true
  - script: |
82
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
83
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
84
85
      echo "##vso[task.setvariable variable=OS_NAME]macos"
      echo "##vso[task.setvariable variable=AZURE]true"
86
87
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
    displayName: 'Set variables'
88
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
89
    displayName: Setup
90
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
91
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
92
  - task: PublishBuildArtifacts@1
93
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
94
95
96
97
98
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
      artifactName: PackageAssets
      artifactType: container
###########################################
99
- job: Windows
Guolin Ke's avatar
Guolin Ke committed
100
###########################################
101
102
103
104
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
105
106
107
    matrix:
      regular:
        TASK: regular
108
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
109
110
111
112
113
      sdist:
        TASK: sdist
        PYTHON_VERSION: 2.7
      bdist:
        TASK: bdist
114
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
115
  steps:
116
  - task: CondaEnvironment@1
Guolin Ke's avatar
Guolin Ke committed
117
    inputs:
118
      createCustomEnvironment: true
119
      updateConda: true
Guolin Ke's avatar
Guolin Ke committed
120
      environmentName: $(CONDA_ENV)
121
      packageSpecs: 'python=$(PYTHON_VERSION) numpy nose scipy scikit-learn pandas matplotlib python-graphviz pytest'
Guolin Ke's avatar
Guolin Ke committed
122
      createOptions: '-q'
123
  - powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
124
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
125
  - task: PublishBuildArtifacts@1
126
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
127
    inputs:
128
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
129
130
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
131

132
###########################################
133
- job: Package
134
###########################################
Guolin Ke's avatar
Guolin Ke committed
135
136
137
138
  dependsOn:
  - Linux
  - MacOS
  - Windows
139
  condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
140
141
  pool:
    vmImage: 'vs2017-win2016'
Guolin Ke's avatar
Guolin Ke committed
142
143
144
145
146
147
148
149
  steps:
  # Download all agent packages from all previous phases
  - task: DownloadBuildArtifacts@0
    displayName: Download package assets
    inputs:
      artifactName: PackageAssets
      downloadPath: $(Build.SourcesDirectory)/binaries
  - script: |
150
151
152
153
154
155
156
      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
157
158
  - task: PublishBuildArtifacts@1
    inputs:
159
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
160
      artifactName: NuGet
Guolin Ke's avatar
Guolin Ke committed
161
      artifactType: container