79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
steps:
|
|
# Checkout repository
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
|
|
# Set python version
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '3.7'
|
|
|
|
# Install build dependencies
|
|
- script: |
|
|
git clone --depth 1 https://github.com/mlpack/jenkins-conf.git conf
|
|
|
|
sudo add-apt-repository ppa:mhier/libboost-latest
|
|
sudo apt-get update
|
|
|
|
# Remove BOOST_ROOT from the environment to prevent attempting to use a
|
|
# boost which is incompatible with the compiler.
|
|
unset BOOST_ROOT
|
|
echo "##vso[task.setvariable variable=BOOST_ROOT]"$BOOST_ROOT
|
|
|
|
sudo apt-get install -y --allow-unauthenticated libopenblas-dev liblapack-dev g++ libboost1.70-dev libarmadillo-dev xz-utils
|
|
sudo apt-get install -y --allow-unauthenticated python3-pip python3-numpy
|
|
|
|
|
|
sudo /opt/hostedtoolcache/Python/3.7.7/x64/bin/python3 -m pip install "Cython>0.24"
|
|
sudo /opt/hostedtoolcache/Python/3.7.7/x64/bin/python3 -m pip install --upgrade --ignore-installed setuptools
|
|
sudo /opt/hostedtoolcache/Python/3.7.7/x64/bin/python3 -m pip install pandas
|
|
|
|
if [ 'a$(julia.version)' != 'a' ]; then
|
|
wget https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.0-linux-x86_64.tar.gz
|
|
sudo tar -C /opt/ -xvpf julia-1.3.0-linux-x86_64.tar.gz
|
|
fi
|
|
|
|
# Install armadillo.
|
|
curl https://data.kurg.org/armadillo-8.400.0.tar.xz | tar -xvJ && cd armadillo*
|
|
cmake . && make && sudo make install && cd ..
|
|
displayName: 'Install Build Dependencies'
|
|
|
|
# Configure mlpack (CMake)
|
|
- script: |
|
|
unset BOOST_ROOT
|
|
mkdir build && cd build
|
|
export GOPATH=$PWD/src/mlpack/bindings/go
|
|
go get -u -t gonum.org/v1/gonum/...
|
|
cmake $(CMakeArgs) ..
|
|
displayName: 'CMake'
|
|
|
|
# Build mlpack
|
|
- script: cd build && make
|
|
condition: eq(variables['CMakeArgs'], '-DDEBUG=ON -DPROFILE=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_JULIA_BINDINGS=OFF -DBUILD_GO_BINDINGS=OFF')
|
|
displayName: 'Build'
|
|
|
|
# Build mlpack
|
|
- script: cd build && make -j2
|
|
condition: ne(variables['CMakeArgs'], '-DDEBUG=ON -DPROFILE=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_JULIA_BINDINGS=OFF -DBUILD_GO_BINDINGS=OFF')
|
|
displayName: 'Build'
|
|
|
|
# Run tests via ctest.
|
|
- script: cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest -T Test .
|
|
displayName: 'Run tests via ctest'
|
|
|
|
# Publish test results to Azure Pipelines
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: cTest
|
|
testResultsFiles: build/Testing/*/Test.xml
|
|
failTaskOnFailedTests: true
|
|
displayName: 'Publish tests'
|
|
|
|
# Publish build artifacts to Azure Pipelines
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathtoPublish: 'build/Testing/'
|
|
artifactName: 'Tests'
|
|
displayName: 'Publish artifacts test results'
|