trigger: - mainline - multi_type_support_refactor jobs: - job: formatting_check pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self - script: python -m pip install --upgrade pip cpplint pylint numpy scipy scikit-learn pytest displayName: 'Installing pylint and cpplint...' - script: make lint displayName: 'Running pylint and cpplint...' - job: linux_build pool: vmImage: 'ubuntu-latest' steps: - checkout: self - script: tests/ci_build/ci_build.sh cpu tests/ci_build/build_via_cmake.sh displayName: 'Building Treelite...' - script: | 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/' - script: | tests/ci_build/ci_build.sh cpu bash -c "cd runtime/python/ && python setup.py bdist_wheel --universal" displayName: 'Packaging Python wheel for Treelite runtime...' - task: PublishPipelineArtifact@1 inputs: artifactName: 'runtime_python_linux_whl' targetPath: 'runtime/python/dist/' - job: win_build pool: vmImage: 'vs2017-win2016' steps: - checkout: self - 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...' - script: | mkdir build cd build cmake .. -G"Visual Studio 15 2017 Win64" -DBUILD_CPP_TEST=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: | .\build\treelite_cpp_test.exe displayName: 'Running C++ tests...' - script: | call 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/' - script: | call activate cd runtime\python python setup.py bdist_wheel --universal displayName: 'Packaging Python wheel for Treelite runtime...' - task: PublishPipelineArtifact@1 inputs: artifactName: 'runtime_python_win_whl' targetPath: 'runtime/python/dist/' - job: cpp_python_coverage pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self - script: sudo apt-get install lcov ninja-build displayName: 'Installing lcov and Ninja...' - script: | mkdir build/ cd build/ cmake .. -DTEST_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CPP_TEST=ON -GNinja ninja displayName: 'Building Treelite...' - script: | python -m pip install --upgrade pip numpy scipy pandas pytest pytest-cov scikit-learn lightgbm python -m pip install xgboost displayName: 'Setting up Python environment...' - script: ./build/treelite_cpp_test displayName: 'Running C++ integration tests...' - script: python -m pytest --cov=treelite --cov=treelite_runtime -v --fulltrace tests/python displayName: 'Running Python integration tests...' env: PYTHONPATH: ./python:./runtime/python - script: | lcov --directory . --capture --output-file coverage.info lcov --remove coverage.info '*/usr/*' --output-file coverage.info lcov --remove coverage.info '*/build/_deps/*' --output-file coverage.info displayName: 'Collecting coverage data...' - script: bash <(curl -s https://codecov.io/bash) -X gcov || 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_coverage pool: vmImage: 'windows-latest' steps: - checkout: self - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" displayName: 'Add conda to PATH' - script: | call activate conda install --yes --quiet -c conda-forge numpy scipy scikit-learn pandas scikit-learn pytest pytest-cov displayName: 'Setting up Python environment...' - script: | call activate python -m pip install xgboost lightgbm codecov displayName: 'Setting up Python environment...' - script: | mkdir build cd build cmake .. -G"Visual Studio 16 2019" -A x64 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 activate mkdir temp python -m pytest --basetemp="$(System.DefaultWorkingDirectory)\temp" --cov=treelite --cov=treelite_runtime --cov-report xml -v --fulltrace tests\python displayName: 'Running Python tests...' env: PYTHONPATH: '$(System.DefaultWorkingDirectory)\python;$(System.DefaultWorkingDirectory)\runtime\python;$(PYTHONPATH)' - script: | call activate python -m codecov -f coverage.xml displayName: 'Submitting 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 - 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_wheel_test dependsOn: linux_build pool: vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true - checkout: self - script: python -m pip install --upgrade pip numpy scipy pandas pytest scikit-learn xgboost lightgbm displayName: 'Setting up Python environment...' - task: DownloadPipelineArtifact@0 inputs: artifactName: 'python_linux_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite Python wheel for Linux...' - task: DownloadPipelineArtifact@1 inputs: artifactName: 'runtime_python_linux_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite runtime Python wheel for Linux...' - script: | python -m pip install *.whl displayName: 'Installing Treelite into Python environment...' - script: python -m pytest -v --fulltrace tests/python/test_basic.py displayName: 'Running Python tests...' - job: win_python_wheel_test dependsOn: win_build pool: vmImage: 'windows-latest' steps: - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" displayName: 'Add conda to PATH' - script: | call activate conda install --yes --quiet -c conda-forge numpy scipy scikit-learn pandas scikit-learn pytest displayName: 'Setting up Python environment...' - script: | call activate python -m pip install xgboost lightgbm displayName: 'Setting up Python environment...' - task: DownloadPipelineArtifact@0 inputs: artifactName: 'python_win_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite Python wheel for Windows...' - task: DownloadPipelineArtifact@1 inputs: artifactName: 'runtime_python_win_whl' targetPath: $(System.DefaultWorkingDirectory) displayName: 'Downloading Treelite runtime Python wheel for Windows...' - script: | call activate for /R %%i in (*.whl) DO python -m pip install "%%i" displayName: 'Installing Treelite into Python environment...' - script: | call activate mkdir temp python -m pytest --basetemp="$(System.DefaultWorkingDirectory)\temp" -v --fulltrace tests\python\test_basic.py displayName: 'Running Python tests...'