Skip to content

Commit

Permalink
add initial azure pipelines definition
Browse files Browse the repository at this point in the history
test macos build
  • Loading branch information
vigsterkr committed Sep 25, 2018
1 parent ef0e4dc commit 3229832
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 118 deletions.
66 changes: 66 additions & 0 deletions .ci/ci.yml
@@ -0,0 +1,66 @@
jobs:
- job: libshogun
displayName: Linux libshogun CI Tests

pool:
vmImage: ubuntu-16.04

strategy:
maxParallel: 2
matrix:
clang:
CC: "clang"
CXX: "clang++"
gcc:
CC: "gcc"
CXX: "g++"

variables:
testRunTitle: '$(build.sourceBranchName)-debian'
testRunPlatform: debian
imageName: 'shogun/shogun-dev'
targetPrefix: '$(build.binariesDirectory)/opt'
libshogunArtifactName: 'libshogun-$(CC)'
libshogunArchive: '$(Build.ArtifactStagingDirectory)/libshogun-$(Build.BuildId).tar.xz'
ccacheDir: $(build.binariesDirectory)/ccache
ccacheArtifactName: 'ccache-$(CC)'
ccacheArchive: '$(Build.ArtifactStagingDirectory)/ccache-$(Build.BuildId).tar.xz'

steps:
- template: ./docker-steps.yml

- job: python
displayName: Python Interface CI Tests
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: '-DLIBSHOGUN=OFF -DINTERFACE_PYTHON=ON'

- job: macOS
displayName: macOS CI Tests

variables:
testRunTitle: '$(build.sourceBranchName)-macos'
testRunPlatform: macos
ccacheDir: $(Agent.HomeDirectory)/.ccache
ccacheArtifactName: 'ccache-macos'

pool:
vmImage: xcode9-macos10.13

steps:
- template: ./macos-steps.yml

- template: ./windows-steps.yml
parameters:
buildConfiguration: Release
118 changes: 118 additions & 0 deletions .ci/docker-steps.yml
@@ -0,0 +1,118 @@
steps:
- checkout: self
clean: true
fetchDepth: 5
submodules: true

- script: mkdir $(ccacheDir) $(targetPrefix)
condition:
displayName: Create CCache directory

#- task: DownloadBuildArtifacts@0
# displayName: 'Download ccache'
# inputs:
# artifactName: $(ccacheArtifactName)
# downloadPath: $(ccacheDir)

- ${{ if ne(parameters.cmakeOptions, '') }}:
- task: DownloadBuildArtifacts@0
displayName: 'Download libshogun'
inputs:
artifactName: $(libshogunArtifactName)
downloadPath: $(targetPrefix)

- task: ExtractFiles@1
displayName: 'Extract libshogun archive'
inputs:
archiveFilePatterns: '$(targetPrefix)/*.tar.xz'
destinationFolder: $(targetPrefix)
cleanDestinationFolder: True

- script: |
ls -la $(targetPrefix)
displayName: Debug

- task: docker@0
displayName: Setup
inputs:
action: 'Run an image'
imageName: $(imageName)
volumes: |
$(build.sourcesDirectory):/src
$(build.binariesDirectory):/build
envVars: |
CCACHE_DIR=/build/ccache
CC=$(CC)
CXX=$(CXX)
workDir: '/build'
containerCommand: 'cmake -DENABLE_TESTING=ON ${{ parameters.cmakeOptions }} -DCMAKE_INSTALL_PREFIX=$(targetPrefix) /src'
detached: false

- task: docker@0
displayName: Build
inputs:
action: 'Run an image'
imageName: $(imageName)
volumes: |
$(build.sourcesDirectory):/src
$(build.binariesDirectory):/build
envVars: |
CCACHE_DIR=/build/ccache
workDir: '/build'
containerCommand: 'make -s'
detached: false

- task: docker@0
displayName: Install
inputs:
action: 'Run an image'
imageName: $(imageName)
volumes: |
$(build.sourcesDirectory):/src
$(build.binariesDirectory):/build
workDir: '/build'
containerCommand: 'make install'
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

- ${{ if eq(parameters.cmakeOptions, '') }}:
- task: ArchiveFiles@2
displayName: 'Archive LibShogun'
inputs:
rootFolderOrFile: $(targetPrefix)
archiveType: tar
tarCompression: xz
archiveFile: $(libshogunArchive)

- task: PublishBuildArtifacts@1
displayName: 'Publish LibShogun archive'
inputs:
pathtoPublish: $(libshogunArchive)
artifactName: $(libshogunArtifactName)
publishLocation: 'Container'

- task: ArchiveFiles@2
displayName: 'Archive CCache'
inputs:
rootFolderOrFile: $(ccacheDir)
archiveType: tar
tarCompression: xz
archiveFile: $(ccacheArchive)

- task: PublishBuildArtifacts@1
displayName: 'Publish CCache archive'
inputs:
pathtoPublish: $(ccacheArchive)
artifactName: $(ccacheArtifactName)
publishLocation: 'Container'
36 changes: 36 additions & 0 deletions .ci/macos-steps.yml
@@ -0,0 +1,36 @@
steps:
- checkout: self
clean: true
fetchDepth: 5
submodules: true

- task: DownloadBuildArtifacts@0
displayName: 'Download ccache'
inputs:
artifactName: $(ccacheArtifactName)
downloadPath: $(ccacheDir)

- bash: |
brew update
brew install cmake ccache pkg-config arpack eigen glpk hdf5 json-c lapack lzo nlopt snappy xz
displayName: Install dependencies
condition: always()

- 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

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(ccacheDir)
artifactName: $(ccacheArtifactName)
publishLocation: 'Container'
16 changes: 16 additions & 0 deletions .ci/setup_clcache.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%
49 changes: 49 additions & 0 deletions .ci/windows-steps.yml
@@ -0,0 +1,49 @@
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: |
.ci\\setup_clcache.cmd
displayName: Setup CLCache
- 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 ..'

- task: VSBuild@1
displayName: Build
inputs:
solution: 'build/shogun.sln'
platform: x64
configuration: ${{ parameters.buildConfiguration }}

- script: ctest -j%NUMBER_OF_PROCESSORS% -C ${{ parameters.buildConfiguration }} -V
displayName: Test
workingDirectory: build
79 changes: 0 additions & 79 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -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:
Expand Down

0 comments on commit 3229832

Please sign in to comment.