trigger: - master jobs: - job: formatting_check pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: python -m pip install --upgrade pip cpplint pylint numpy scipy displayName: 'Installing pylint and cpplint...' - script: make lint displayName: 'Running pylint and cpplint...' - job: linux_build pool: vmImage: 'ubuntu-latest' steps: - checkout: self submodules: recursive - script: tests/ci_build/ci_build.sh cpu tests/ci_build/build_via_cmake.sh -DENABLE_PROTOBUF=ON displayName: 'Building Treelite...' - script: | rm -rfv python/dist python/build tests/ci_build/ci_build.sh cpu bash -c "cd python/ && python setup.py bdist_wheel --universal" displayName: 'Packaging Python wheel for Treelite...' - task: PublishPipelineArtifact@0 inputs: artifactName: 'python_linux_whl' targetPath: 'python/dist/' - job: osx_build pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: | rm -rf build/ mkdir build cd build cmake .. -DENABLE_PROTOBUF=ON make -j displayName: 'Building Treelite...' - script: | rm -rfv python/dist python/build cd python/ pip install wheel setuptools python setup.py bdist_wheel --universal displayName: 'Packaging Python wheel for Treelite...' - task: PublishPipelineArtifact@0 inputs: artifactName: 'python_osx_whl' targetPath: 'python/dist/' - job: win_build pool: vmImage: 'vs2015-win2012r2' steps: - checkout: self submodules: recursive - powershell: | (New-Object System.Net.WebClient).DownloadFile("https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe", ".\Miniconda3.exe") displayName: 'Downloading Miniconda...' - script: start /wait "" Miniconda3.exe /InstallationType=JustMe /RegisterPython=0 /S /D=$(Agent.BuildDirectory)\CONDA displayName: 'Installing Miniconda...' - script: | call $(Agent.BuildDirectory)\CONDA\Scripts\activate conda install numpy scipy scikit-learn pandas python -m pip install wheel setuptools displayName: 'Setting up Python environment...' - script: | rmdir build /s /q mkdir build cd build cmake .. -G"Visual Studio 14 2015 Win64" -DENABLE_PROTOBUF=ON displayName: 'Generating Visual Studio solution...' - task: MSBuild@1 inputs: solution: 'build/*.sln' msbuildArchitecture: 'x64' msbuildArguments: '/p:Configuration=Release /m /nodeReuse:false' displayName: 'Building Treelite...' - script: | call $(Agent.BuildDirectory)\CONDA\Scripts\activate cd python python setup.py bdist_wheel --universal displayName: 'Packaging Python wheel for Treelite...' - task: PublishPipelineArtifact@0 inputs: artifactName: 'python_win_whl' targetPath: 'python/dist/' - job: cpp_coverage pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: sudo apt-get install lcov displayName: 'Installing lcov...' - script: | rm -rfv build/ mkdir build/ cd build/ cmake .. -DTEST_COVERAGE=ON -DENABLE_PROTOBUF=ON -DCMAKE_BUILD_TYPE=Debug make -j displayName: 'Building Treelite...' - script: python -m pip install numpy scipy pandas pytest scikit-learn xgboost lightgbm displayName: 'Setting up Python environment...' - script: | PYTHONPATH=./python python -m pytest -v --fulltrace tests/python lcov --directory . --capture --output-file coverage.info lcov --remove coverage.info '/usr/*' --output-file coverage.info lcov --remove coverage.info '*3rdparty*' --output-file coverage.info lcov --remove coverage.info '*dmlc-core*' --output-file coverage.info displayName: 'Running integration tests...' - script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" displayName: 'Submitting C++ code coverage data to CodeCov...' env: CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255 - job: java_coverage pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: | cd runtime/java/treelite4j mvn test -DJNI.args=cpp-coverage displayName: 'Running integration tests for Java runtime (treelite4j)...' - script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" displayName: 'Submitting Java code (treelite4j) coverage data to CodeCov...' env: CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255 - job: linux_python_test dependsOn: linux_build pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: python -m pip install numpy scipy pandas pytest pytest-cov scikit-learn xgboost lightgbm coverage displayName: 'Setting up Python environment...' - task: DownloadPipelineArtifact@0 inputs: artifactName: 'python_linux_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite Python wheel for Linux...' - script: | mkdir -p lib/ cd lib/ unzip -j ../*.whl 'treelite-*.data/data/treelite/libtreelite.so' cd ../runtime/native mkdir -p lib/ cd lib/ unzip -j ../../../*.whl 'treelite-*.data/data/treelite/libtreelite_runtime.so' mkdir -p ../build cd ../build cmake .. displayName: 'Installing Treelite into Python environment...' - script: python -m pytest -v --fulltrace tests/python --cov=./ displayName: 'Running Python tests...' env: PYTHONPATH: ./python - script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" displayName: 'Submitting code coverage data to CodeCov...' env: CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255 - job: osx_python_test dependsOn: osx_build pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self submodules: recursive - script: | python -m pip install numpy scipy pandas pytest pytest-cov scikit-learn lightgbm coverage brew install gcc@7 libomp displayName: 'Setting up Python environment...' - task: DownloadPipelineArtifact@0 inputs: artifactName: 'python_osx_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite Python wheel for Mac OSX...' - script: | mkdir -p lib/ cd lib/ unzip -j ../*.whl 'treelite-*.data/data/treelite/libtreelite.dylib' cd ../runtime/native mkdir -p lib/ cd lib/ unzip -j ../../../*.whl 'treelite-*.data/data/treelite/libtreelite_runtime.dylib' mkdir -p ../build cd ../build cmake .. displayName: 'Installing Treelite into Python environment...' - script: python -m pytest -v --fulltrace tests/python --cov=./ displayName: 'Running Python tests...' env: GCC_PATH: gcc-7 PYTHONPATH: ./python - script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" displayName: 'Submitting code coverage data to CodeCov...' env: CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255 - job: win_python_test dependsOn: win_build pool: vmImage: 'vs2017-win2016' steps: - checkout: self submodules: recursive - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" displayName: 'Add conda to PATH' - script: | call activate conda install --yes --quiet numpy scipy scikit-learn pandas displayName: 'Setting up Python environment...' - task: DownloadPipelineArtifact@0 inputs: artifactName: 'python_win_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite Python wheel for Windows...' - powershell: | Dir *.whl | Rename-Item -newname { $_.name -replace ".whl", ".zip" } Expand-Archive *.zip -DestinationPath .\whl_content New-Item .\lib -ItemType Directory -ea 0 New-Item .\runtime\native\lib -ItemType Directory -ea 0 New-Item .\build -ItemType Directory -ea 0 Move-Item -Path .\whl_content\treelite-*.data\data\treelite\treelite.dll -Destination .\lib Move-Item -Path .\whl_content\treelite-*.data\data\treelite\treelite_runtime.dll -Destination .\runtime\native\lib Remove-Item .\whl_content -Force -Recurse Set-Location -Path .\build cmake .. -G"Visual Studio 15 2017 Win64" displayName: 'Installing Treelite into Python environment...' - script: | call activate python -m pip install wheel setuptools xgboost lightgbm pytest pytest-cov python -m pytest -v --fulltrace tests\python --cov=./ displayName: 'Running Python tests...' env: PYTHONPATH: .\python - script: | choco install codecov codecov displayName: 'Submitting code coverage data to CodeCov...' env: CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255