From 78123c0d6b9ace08d7f1768d6afe3f5225163e1f 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 | 61 +++++++++++++++++++++++++++++++++ .ci/docker-steps.yml | 41 ++++++++++++++++++++++ .ci/macos-steps.yml | 23 +++++++++++++ .ci/setup_conda_environment.cmd | 28 +++++++++++++++ .ci/windows-steps.yml | 31 +++++++++++++++++ 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..e609f4f36cd --- /dev/null +++ b/.ci/ci.yml @@ -0,0 +1,61 @@ +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 + +- job: Windows + displayName: Windows CI Tests + pool: + vmImage: 'vs2017-win2016' + + strategy: + matrix: + py36: + CONDA_PY: "3.6.*" + CONDA_ENV: shogun + + steps: + - template: ./windows-steps.yml + parameters: + buildConfiguration: Release + generator: Visual Studio 15 2017 Win64 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..6c0c247f785 --- /dev/null +++ b/.ci/setup_conda_environment.cmd @@ -0,0 +1,28 @@ +@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 env create -n %CONDA_ENV% -q -y python=%CONDA_PY% setuptools numpy scipy eigen rxcpp cmake snappy zlib ctags ply ninja + +call activate %CONDA_ENV% +conda list + +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..9754d14006f --- /dev/null +++ b/.ci/windows-steps.yml @@ -0,0 +1,31 @@ +steps: +- checkout: self + clean: true + fetchDepth: 5 + submodules: true + +- task: CondaEnvironment@1 + displayName: Install conda + inputs: + packageSpecs: '' + updateConda: false + +- script: | + .ci\\setup_conda_environment.cmd + displayName: Install dependencies + +- task: CMake@1 + displayName: Setup + inputs: + cmakeArgs: -G "${{ parameters.generator }}" -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: