.vsts-ci.yml 5.36 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: 7
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
        PYTHON_VERSION: 3.6
28
29
      swig:
        TASK: swig
30
31
32
33
34
35
36
37
      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
38
        METHOD: source
39
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
40
  steps:
41
  - script: |
42
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
43
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
44
45
      echo "##vso[task.setvariable variable=OS_NAME]linux"
      echo "##vso[task.setvariable variable=AZURE]true"
46
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
Nikita Titov's avatar
Nikita Titov committed
47
48
      echo "##vso[task.prependpath]$CONDA/bin"
      AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK
49
50
51
52
53
      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'
54
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
55
    displayName: Setup
56
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
57
    displayName: Test
Nikita Titov's avatar
Nikita Titov committed
58
59
60
61
62
63
  - task: PublishBuildArtifacts@1
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
64
###########################################
65
- job: MacOS
Guolin Ke's avatar
Guolin Ke committed
66
###########################################
67
  variables:
68
    COMPILER: clang
69
70
71
72
  pool:
    vmImage: 'macOS-10.13'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
73
74
75
    matrix:
      regular:
        TASK: regular
76
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
77
78
      sdist:
        TASK: sdist
79
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
80
81
82
      bdist:
        TASK: bdist
  steps:
83
  - script: |
84
      echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
85
      echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
86
87
      echo "##vso[task.setvariable variable=OS_NAME]macos"
      echo "##vso[task.setvariable variable=AZURE]true"
88
      echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
Nikita Titov's avatar
Nikita Titov committed
89
90
91
      CONDA=$AGENT_HOMEDIRECTORY/miniconda
      echo "##vso[task.setvariable variable=CONDA]$CONDA"
      echo "##vso[task.prependpath]$CONDA/bin"
92
    displayName: 'Set variables'
93
  - bash: $(Build.SourcesDirectory)/.ci/setup.sh
94
    displayName: Setup
95
  - bash: $(Build.SourcesDirectory)/.ci/test.sh
96
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
97
  - task: PublishBuildArtifacts@1
98
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
99
100
101
102
103
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)' 
      artifactName: PackageAssets
      artifactType: container
###########################################
104
- job: Windows
Guolin Ke's avatar
Guolin Ke committed
105
###########################################
106
107
108
109
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    maxParallel: 3
Guolin Ke's avatar
Guolin Ke committed
110
111
112
    matrix:
      regular:
        TASK: regular
113
        PYTHON_VERSION: 3.5
Guolin Ke's avatar
Guolin Ke committed
114
115
116
117
118
      sdist:
        TASK: sdist
        PYTHON_VERSION: 2.7
      bdist:
        TASK: bdist
119
        PYTHON_VERSION: 3.6
Guolin Ke's avatar
Guolin Ke committed
120
  steps:
Nikita Titov's avatar
Nikita Titov committed
121
122
123
124
  - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
    displayName: Enable conda
  - script: |
      conda update -q -y conda
125
      conda create -q -y -n %CONDA_ENV% python=%PYTHON_VERSION% matplotlib numpy pandas psutil pytest python-graphviz scikit-learn scipy
Nikita Titov's avatar
Nikita Titov committed
126
      cmd /c "activate %CONDA_ENV% & powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1"
127
    displayName: Test
Guolin Ke's avatar
Guolin Ke committed
128
  - task: PublishBuildArtifacts@1
129
    condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
Guolin Ke's avatar
Guolin Ke committed
130
    inputs:
131
      pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Guolin Ke's avatar
Guolin Ke committed
132
133
      artifactName: PackageAssets
      artifactType: container
Guolin Ke's avatar
Guolin Ke committed
134

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