appveyor.yml 2.41 KB
Newer Older
1
2
3
4
5
version: 2.0.5.{build}

configuration:  # A trick to construct a build matrix
  - 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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%  # Delete sh.exe from PATH (mingw32-make fix)
  - 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"""}
          "3.4" {$env:MINICONDA = """C:\Miniconda3-x64"""}
          "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
  - conda create -q -n test-env python=%PYTHON_VERSION% numpy nose scipy scikit-learn pandas matplotlib pep8 pytest
  - activate test-env
Guolin Ke's avatar
Guolin Ke committed
35

Guolin Ke's avatar
Guolin Ke committed
36
37
build_script:
  - mkdir build && cd 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
41
  - cd ..

test_script:
42
  - pytest tests/c_api_test/test_.py
Guolin Ke's avatar
Guolin Ke committed
43
  - cd python-package && python setup.py sdist --formats gztar
44
45
46
47
48
  - cd dist
  - IF "%COMPILER%"=="MINGW" (
    pip install lightgbm-%LGB_VER%.tar.gz --install-option=--mingw -v)
    ELSE (
    pip install lightgbm-%LGB_VER%.tar.gz -v)
Guolin Ke's avatar
Guolin Ke committed
49
50
  - cd ../..
  - pytest tests/python_package_test
51
  - IF "%COMPILER%"=="MINGW" appveyor exit  # skip all further steps
Guolin Ke's avatar
Guolin Ke committed
52
  - cd python-package && python setup.py bdist_wheel --plat-name=win-amd64 --universal
53
54

after_test:
Guolin Ke's avatar
Guolin Ke committed
55
56
57
  - cd ../.nuget
  - python create_nuget.py
  - nuget.exe pack LightGBM.nuspec
Guolin Ke's avatar
Guolin Ke committed
58
59
60

nuget:
  project_feed: true
Guolin Ke's avatar
Guolin Ke committed
61

Guolin Ke's avatar
Guolin Ke committed
62
63
64
artifacts:
- path: Release/lib_lightgbm.dll
  name: Library
Guolin Ke's avatar
Guolin Ke committed
65
66
- path: Release/lightgbm.exe
  name: Exe
Guolin Ke's avatar
Guolin Ke committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- path: python-package/dist/*
  name: Pip
- path: .nuget/*.nupkg
  name: Nuget

deploy:
  release: $(APPVEYOR_REPO_TAG_NAME)
  provider: GitHub
  auth_token:
    secure: KR44XwtxY0cLlVpQwY726BvC6gzT0cYTf0ahJ4cSvvS0UVoSJxkR900ICfVXHRoT
  artifact: Library,Exe,Pip,Nuget
  force_update: true
  draft: true
  on:
    appveyor_repo_tag: true