.appveyor.yml 2.6 KB
Newer Older
1
version: 2.1.2.{build}
2

3
configuration:  # a trick to construct a build matrix
4
5
  - 3.5
  - 3.6
Guolin Ke's avatar
Guolin Ke committed
6
7
8

environment:
  matrix:
9
10
11
12
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
      COMPILER: MSVC
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      COMPILER: MINGW
Guolin Ke's avatar
Guolin Ke committed
13
14
15

clone_depth: 50

16
install:
17
  - git submodule update --init --recursive  # get `compute` folder
18
  - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%  # delete sh.exe from PATH (mingw32-make fix)
19
20
21
22
23
  - set PATH=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
  - set PYTHON_VERSION=%CONFIGURATION%
  - ps: >-
      switch ($env:PYTHON_VERSION) {
          "2.7" {$env:MINICONDA = """C:\Miniconda-x64"""}
24
          "3.4" {$env:MINICONDA = """C:\Miniconda34-x64"""}
25
26
27
28
29
30
31
32
          "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%
  - 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
34
  - activate test-env
Guolin Ke's avatar
Guolin Ke committed
35

Guolin Ke's avatar
Guolin Ke committed
36
build_script:
37
  - mkdir %APPVEYOR_BUILD_FOLDER%\build && cd %APPVEYOR_BUILD_FOLDER%\build
Guolin Ke's avatar
Guolin Ke committed
38
  - cmake -DCMAKE_GENERATOR_PLATFORM=x64 .. && cmake --build . --target ALL_BUILD --config Release
Guolin Ke's avatar
Guolin Ke committed
39
40

test_script:
41
42
  - pytest %APPVEYOR_BUILD_FOLDER%\tests\c_api_test\test_.py
  - cd %APPVEYOR_BUILD_FOLDER%\python-package && python setup.py sdist --formats gztar
43
  - IF "%COMPILER%"=="MINGW" (
44
    pip install %APPVEYOR_BUILD_FOLDER%\python-package\dist\lightgbm-%LGB_VER%.tar.gz --install-option=--mingw -v)
45
    ELSE (
46
47
48
    pip install %APPVEYOR_BUILD_FOLDER%\python-package\dist\lightgbm-%LGB_VER%.tar.gz -v)
  - pytest %APPVEYOR_BUILD_FOLDER%\tests\python_package_test
  - cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide
49
  - ps: >-
50
      @("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py"  # prevent interactive window mode
51
52
53
54
55
  - ps: >-
      foreach ($file in @(Get-ChildItem *.py)) {
        python $file
        if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
      }  # run all examples
56
  - IF "%COMPILER%"=="MINGW" appveyor exit  # skip all further steps
57
  - cd %APPVEYOR_BUILD_FOLDER%\python-package && python setup.py bdist_wheel --plat-name=win-amd64 --universal
58

Guolin Ke's avatar
Guolin Ke committed
59
60
61
artifacts:
- path: Release/lib_lightgbm.dll
  name: Library
Guolin Ke's avatar
Guolin Ke committed
62
63
- path: Release/lightgbm.exe
  name: Exe
Guolin Ke's avatar
Guolin Ke committed
64
65
66
- path: python-package/dist/*
  name: Pip