From 94e8113b22188f22383bdeffe7dccc66a71f043e Mon Sep 17 00:00:00 2001 From: Viktor Gal Date: Mon, 24 Sep 2018 09:10:49 -0400 Subject: [PATCH] add initial azure pipelines definition test macos build --- .ci/ci.yml | 48 +++++++++++++++++++++++++++++++++ .ci/docker-steps.yml | 41 ++++++++++++++++++++++++++++ .ci/macos-steps.yml | 23 ++++++++++++++++ .ci/setup_conda_environment.cmd | 27 +++++++++++++++++++ .ci/windows-steps.yml | 45 +++++++++++++++++++++++++++++++ README.md | 3 +-- 6 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 .ci/ci.yml create mode 100644 .ci/docker-steps.yml create mode 100644 .ci/macos-steps.yml create mode 100644 .ci/setup_conda_environment.cmd create mode 100644 .ci/windows-steps.yml diff --git a/.ci/ci.yml b/.ci/ci.yml new file mode 100644 index 00000000000..2e704f35863 --- /dev/null +++ b/.ci/ci.yml @@ -0,0 +1,48 @@ +jobs: +- job: libshogun + displayName: Linux libshogun + + pool: + vmImage: ubuntu-16.04 + + variables: + testRunTitle: '$(build.sourceBranchName)-debian' + testRunPlatform: debian + imageName: 'shogun/shogun-dev' + + steps: + - template: ./docker-steps.yml + +- job: python + displayName: Python Interface + dependsOn: libshogun + + pool: + vmImage: ubuntu-16.04 + + variables: + testRunTitle: '$(build.sourceBranchName)-debian' + testRunPlatform: debian + imageName: 'shogun/shogun-dev' + + steps: + - template: ./docker-steps.yml + parameters: + cmakeOptions: 'DINTERFACE_PYTHON=ON' + +- job: macOS + displayName: macOS CI Tests + + variables: + testRunTitle: '$(build.sourceBranchName)-macos' + testRunPlatform: macos + + pool: + vmImage: xcode9-macos10.13 + + steps: + - template: ./macos-steps.yml + +- template: ./windows-steps.yml + parameters: + buildConfiguration: Release diff --git a/.ci/docker-steps.yml b/.ci/docker-steps.yml new file mode 100644 index 00000000000..523a587f1eb --- /dev/null +++ b/.ci/docker-steps.yml @@ -0,0 +1,41 @@ +steps: +- checkout: self + clean: true + fetchDepth: 5 + submodules: true + +- task: docker@0 + displayName: Setup + inputs: + action: 'Run an image' + imageName: $(imageName) + volumes: | + $(build.sourcesDirectory):/src + $(build.binariesDirectory):/build + workDir: '/build' + containerCommand: 'cmake -DENABLE_TESTING=ON ${{ parameters.cmakeOptions }} /src' + detached: false + +- task: docker@0 + displayName: Build + inputs: + action: 'Run an image' + imageName: $(imageName) + volumes: | + $(build.sourcesDirectory):/src + $(build.binariesDirectory):/build + workDir: '/build' + containerCommand: 'make -s' + detached: false + +- task: docker@0 + displayName: Test + inputs: + action: 'Run an image' + imageName: $(imageName) + volumes: | + $(build.sourcesDirectory):/src + $(build.binariesDirectory):/build + workDir: '/build' + containerCommand: 'ctest --output-on-failure -j 2' + detached: false diff --git a/.ci/macos-steps.yml b/.ci/macos-steps.yml new file mode 100644 index 00000000000..3e1b3022402 --- /dev/null +++ b/.ci/macos-steps.yml @@ -0,0 +1,23 @@ +steps: +- checkout: self + clean: true + fetchDepth: 5 + submodules: true + +- bash: | + brew update + brew install cmake ccache pkg-config arpack eigen glpk hdf5 json-c lapack lzo nlopt snappy xz + displayName: Install dependencies + +- task: CMake@1 + displayName: Setup + inputs: + cmakeArgs: -DBUILD_EXAMPLES=OFF -DBUNDLE_JSON=OFF -DBUNDLE_NLOPT=OFF -DENABLE_TESTING=ON -DENABLE_COVERAGE=OFF -DBUILD_META_EXAMPLES=OFF .. + +- script: make -j4 + displayName: Build + workingDirectory: build + +- script: ctest --output-on-failure -j 2 + displayName: Test + workingDirectory: build diff --git a/.ci/setup_conda_environment.cmd b/.ci/setup_conda_environment.cmd new file mode 100644 index 00000000000..7ab3985871f --- /dev/null +++ b/.ci/setup_conda_environment.cmd @@ -0,0 +1,27 @@ +@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/setup_conda_environment.cmd +@rem The cmd /C hack circumvents a regression where conda installs a conda.bat +@rem script in non-root environments. +set CONDA_INSTALL=cmd /C conda install -q -y +set PIP_INSTALL=pip install -q + +@echo on + +@rem Deactivate any environment +call deactivate +@rem add channels +conda config --add channels https://repo.continuum.io/pkgs/free +conda config --add channels conda-forge +@rem Clean up any left-over from a previous build +conda remove --all -q -y -n %CONDA_ENV% +@rem Use clcache for faster builds +pip install -q git+https://github.com/frerich/clcache.git +clcache -s +set CLCACHE_SERVER=1 +set CLCACHE_HARDLINK=1 +powershell.exe -Command "Start-Process clcache-server" +@rem Create the env +conda create -n %CONDA_ENV% -q -y python=%CONDA_PY% setuptools numpy scipy eigen rxcpp cmake snappy zlib ctags ply ninja mkl-devel + +call activate %CONDA_ENV% + +if %errorlevel% neq 0 exit /b %errorlevel% \ No newline at end of file diff --git a/.ci/windows-steps.yml b/.ci/windows-steps.yml new file mode 100644 index 00000000000..1ecd05adac2 --- /dev/null +++ b/.ci/windows-steps.yml @@ -0,0 +1,45 @@ +parameters: + buildConfiguration: Release + +jobs: +- job: Windows + displayName: Windows CI Tests + pool: + vmImage: 'vs2017-win2016' + + strategy: + matrix: + py36_np14: + CONDA_PY: "36" + CONDA_ENV: shogun + + steps: + - checkout: self + clean: true + fetchDepth: 5 + submodules: true + + - task: CondaEnvironment@1 + displayName: Install dependencies + inputs: + createCustomEnvironment: True + environmentName: shogun + packageSpecs: 'python=3.6.* setuptools numpy scipy eigen rxcpp cmake snappy zlib ctags ply ninja mkl-devel' + createOptions: '-c conda-forge' + updateConda: false + + - task: CMake@1 + displayName: Setup + inputs: + cmakeArgs: -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=${{ parameters.buildConfiguration }} -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library -DBUILD_META_EXAMPLES=OFF -DENABLE_TESTING=ON .. + + - task: VSBuild@1 + displayName: Build + inputs: + solution: '$(Build.ArtifactStagingDirectory)/build/shogun.sln' + platform: x64 + configuration: ${{ parameters.buildConfiguration }} + + - script: ctest -j%NUMBER_OF_PROCESSORS% -C ${{ parameters.buildConfiguration }} -V + displayName: Test + workingDirectory: $(Build.ArtifactStagingDirectory)/build diff --git a/README.md b/README.md index 12400432d3f..2d9d7f7bbf8 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ Cite Shogun: Develop branch build status: -[![Build Status](https://travis-ci.org/shogun-toolbox/shogun.svg?branch=develop)](https://travis-ci.org/shogun-toolbox/shogun) -[![Build status](https://ci.appveyor.com/api/projects/status/jx095rnr9qhg8dcv/branch/develop?svg=true)](https://ci.appveyor.com/project/vigsterkr/shogun/branch/develop) +[![Build status](https://dev.azure.com/shogunml/shogun/_apis/build/status/shogun-CI)](https://dev.azure.com/shogunml/shogun/_build/latest?definitionId=-1) [![codecov](https://codecov.io/gh/shogun-toolbox/shogun/branch/develop/graph/badge.svg)](https://codecov.io/gh/shogun-toolbox/shogun) Donate to Shogun via NumFocus: