.appveyor.yml 2.2 KB
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
version: 2.2.2.{build}
2

3
4
5
image: Visual Studio 2015
platform: x64
configuration:  # a trick to construct a build matrix with multiple Python versions
6
  - 3.6
Guolin Ke's avatar
Guolin Ke committed
7
8
9

environment:
  matrix:
10
11
    - COMPILER: MSVC
    - COMPILER: MINGW
Guolin Ke's avatar
Guolin Ke committed
12
13
14

clone_depth: 50

15
install:
16
  - git submodule update --init --recursive  # get `compute` folder
17
  - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%  # delete sh.exe from PATH (mingw32-make fix)
18
  - set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
19
20
21
22
  - set PYTHON_VERSION=%CONFIGURATION%
  - ps: >-
      switch ($env:PYTHON_VERSION) {
          "2.7" {$env:MINICONDA = """C:\Miniconda-x64"""}
23
          "3.4" {$env:MINICONDA = """C:\Miniconda34-x64"""}
24
25
26
27
28
          "3.5" {$env:MINICONDA = """C:\Miniconda35-x64"""}
          "3.6" {$env:MINICONDA = """C:\Miniconda36-x64"""}
          default {$env:MINICONDA = """C:\Miniconda36-x64"""}
      }
  - set PATH=%MINICONDA%;%MINICONDA%\Scripts;%PATH%
29
  - set SKLEARN_SITE_JOBLIB=true  # temp fix for joblib warning in examples
30
31
32
  - ps: $env:LGB_VER = (Get-Content VERSION.txt).trim()
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
33
  - conda create -q -n test-env python=%PYTHON_VERSION% numpy nose scipy scikit-learn pandas matplotlib python-graphviz pytest joblib
34
  - activate test-env
Guolin Ke's avatar
Guolin Ke committed
35

Guolin Ke's avatar
Guolin Ke committed
36
build_script:
37
  - cd %APPVEYOR_BUILD_FOLDER%\python-package
38
  - IF "%COMPILER%"=="MINGW" (
39
    python setup.py install --mingw)
40
    ELSE (
41
42
43
    python setup.py install)

test_script:
44
45
  - pytest %APPVEYOR_BUILD_FOLDER%\tests\python_package_test
  - cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide
46
  - ps: >-
47
      @("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py"  # prevent interactive window mode
48
      (Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py"
49
50
51
52
53
  - ps: >-
      foreach ($file in @(Get-ChildItem *.py)) {
        python $file
        if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
      }  # run all examples
54
55
  - IF "%COMPILER%"=="MINGW" appveyor exit  # skip all further steps

Guolin Ke's avatar
Guolin Ke committed
56
artifacts:
57
- path: python-package\compile\windows\x64\DLL\lib_lightgbm.dll
Guolin Ke's avatar
Guolin Ke committed
58
  name: Library