From 525ca4387f8dbd870e87aef9e15703a0b2f14174 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 | 16 +++++++ .ci/windows-steps.yml | 53 ++++++++++++++++++++++ .travis.yml | 79 --------------------------------- README.md | 3 +- appveyor.yml | 37 --------------- 8 files changed, 182 insertions(+), 118 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 delete mode 100644 .travis.yml delete mode 100644 appveyor.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..da47a1cc571 --- /dev/null +++ b/.ci/setup_conda_environment.cmd @@ -0,0 +1,16 @@ +@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 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" + +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..aa55553075b --- /dev/null +++ b/.ci/windows-steps.yml @@ -0,0 +1,53 @@ +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 jinja2' + createOptions: '-c conda-forge' + updateConda: false + + - script: | + conda list + displayName: DEBUG + + - task: CMake@1 + displayName: Setup + inputs: + cmakeArgs: -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=${{ parameters.buildConfiguration }} -DBUILD_META_EXAMPLES=OFF -DENABLE_TESTING=ON .. + + - script: | + dir $(Build.ArtifactStagingDirectory)\\*.* + displayName: DEBUG + + - 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/.travis.yml b/.travis.yml deleted file mode 100644 index ac344ad548c..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,79 +0,0 @@ -sudo: required -language: cpp -cache: ccache -notifications: - email: false - irc: - channels: - - "irc.freenode.org#shogun" - on_success: change - on_failure: always - template: - - "it's %{author}'s turn to pay the next round of drinks for the massacre he caused in %{repository}: %{build_url}" -env: - global: - - INTERFACE_TEST_OPTIONS="-DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_META_CPP=ON" -matrix: - fast_finish: true - include: - - compiler: gcc - services: docker - - compiler: clang - services: docker - - compiler: gcc - services: docker - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON -DENABLE_CCACHE=OFF" - - CODE_COVERAGE=1 - - compiler: clang - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_PYTHON=ON ${INTERFACE_TEST_OPTIONS}" - - CC=clang - - CXX=clang++ - - compiler: clang - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_RUBY=ON ${INTERFACE_TEST_OPTIONS}" - - CC=clang - - CXX=clang++ - - compiler: clang - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_JAVA=ON ${INTERFACE_TEST_OPTIONS}" - - CC=clang - - CXX=clang++ - - compiler: clang - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_CSHARP=ON ${INTERFACE_TEST_OPTIONS}" - - CC=clang - - CXX=clang++ - - compiler: gcc - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_OCTAVE=ON ${INTERFACE_TEST_OPTIONS}" - - INTERFACE_OCTAVE=true - - compiler: clang - services: docker - env: - - CMAKE_OPTIONS="-DINTERFACE_R=ON ${INTERFACE_TEST_OPTIONS}" - - CC=clang - - CXX=clang++ - allow_failures: - - compiler: gcc - services: docker - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON -DENABLE_CCACHE=OFF" - - CODE_COVERAGE=1 -before_install: - - $TRAVIS_BUILD_DIR/scripts/travis_before_install.sh -before_script: - - $TRAVIS_BUILD_DIR/scripts/travis_before_script.sh -script: - - $TRAVIS_BUILD_DIR/scripts/travis_script.sh -after_success: - - | - if [ $CODE_COVERAGE ] ; then - docker exec -t devenv /bin/sh -c "cd /opt/shogun/build; lcov --directory src/shogun/ --capture --output-file all_coverage.info; lcov --remove all_coverage.info '/usr/*' > coverage.info; rm all_coverage.info; codecov -X gcov" - fi 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: diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e04d6604dc5..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: "{build}" - -cache: - - C:\Users\appveyor\clcache - - third_party/GoogleMock -> cmake/external/GoogleTestNMock.cmake - -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - GENERATOR: Visual Studio 15 2017 Win64 - PYTHON: "3.6" - APPVEYOR_SAVE_CACHE_ON_ERROR: true - -platform: - - x64 - -configuration: - - Release - -install: - - set MINICONDA=C:\Miniconda36-x64 - - set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH% - - call scripts\appveyor-setup.bat - - git submodule -q update --init - -build: - verbosity: minimal - -build_script: - - call scripts\msvc-build.bat - -test_script: - - cd %APPVEYOR_BUILD_FOLDER%\build - - ctest --output-on-failure -C %CONFIGURATION% - -after_build: - - clcache -s