forked from shogun-toolbox/shogun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial azure pipelines definition
- Loading branch information
Showing
13 changed files
with
450 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
parameters: | ||
artifactName: '' | ||
archive: '' | ||
name: '' | ||
dir: '' | ||
|
||
steps: | ||
- task: ArchiveFiles@2 | ||
displayName: ${{ format('Archive {0}', parameters.name) }} | ||
inputs: | ||
rootFolderOrFile: ${{ parameters.dir }} | ||
includeRootFolder: false | ||
archiveType: tar | ||
archiveFile: ${{ parameters.archive }} | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: ${{ format('Publish {0} archive', parameters.name) }} | ||
inputs: | ||
pathtoPublish: ${{ parameters.archive }} | ||
artifactName: ${{ parameters.artifactName }} | ||
publishLocation: 'Container' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
jobs: | ||
- job: libshogun | ||
displayName: Linux libshogun CI Tests | ||
|
||
pool: | ||
vmImage: ubuntu-16.04 | ||
|
||
strategy: | ||
maxParallel: 2 | ||
matrix: | ||
clang: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '' | ||
gcc: | ||
CC: "gcc" | ||
CXX: "g++" | ||
cmakeOptions: '' | ||
|
||
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' | ||
ccacheDir: '$(build.binariesDirectory)/ccache' | ||
ccacheArtifactName: 'ccache-$(CC)' | ||
ccacheArchive: '$(Build.ArtifactStagingDirectory)/ccache-$(Build.BuildId).tar' | ||
|
||
steps: | ||
- template: ./docker-steps.yml | ||
|
||
- job: swig | ||
displayName: Linux SWIG Interface CI Tests | ||
dependsOn: libshogun | ||
|
||
pool: | ||
vmImage: ubuntu-16.04 | ||
|
||
strategy: | ||
maxParallel: 7 | ||
matrix: | ||
python: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_PYTHON=ON' | ||
interfaceName: 'python' | ||
java: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_JAVA=ON' | ||
interfaceName: 'java' | ||
csharp: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_CSHARP=ON' | ||
interfaceName: 'csharp' | ||
r: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_R=ON' | ||
interfaceName: 'r' | ||
lua: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_LUA=ON' | ||
interfaceName: 'lua' | ||
octave: | ||
CC: "gcc" | ||
CXX: "g++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_OCTAVE=ON' | ||
interfaceName: 'octave' | ||
ruby: | ||
CC: "clang" | ||
CXX: "clang++" | ||
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_RUBY=ON' | ||
interfaceName: 'ruby' | ||
|
||
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' | ||
commonSWIGCMakeFlags: '-DLIBSHOGUN=OFF -DDISABLE_UNIT_TESTS=ON -DDISABLE_META_CPP=ON' | ||
ccacheDir: '$(build.binariesDirectory)/ccache' | ||
ccacheArtifactName: 'ccache-$(interfaceName)' | ||
ccacheArchive: '$(Build.ArtifactStagingDirectory)/ccache-$(Build.BuildId).tar' | ||
|
||
steps: | ||
- template: ./docker-steps.yml | ||
parameters: | ||
swig: true | ||
|
||
- job: macOS | ||
displayName: macOS CI Tests | ||
|
||
variables: | ||
testRunTitle: '$(build.sourceBranchName)-macos' | ||
testRunPlatform: macos | ||
ccacheDir: '$(build.binariesDirectory)/ccache' | ||
ccacheArtifactName: 'ccache-macos' | ||
ccacheArchive: '$(Build.ArtifactStagingDirectory)/ccache-$(Build.BuildId).tar' | ||
|
||
pool: | ||
vmImage: xcode9-macos10.13 | ||
|
||
steps: | ||
- template: ./macos-steps.yml | ||
|
||
#- template: ./windows-steps.yml | ||
# parameters: | ||
# buildConfiguration: Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
steps: | ||
- checkout: self | ||
clean: true | ||
fetchDepth: 5 | ||
submodules: true | ||
|
||
- script: mkdir $(ccacheDir) $(targetPrefix) | ||
condition: | ||
displayName: Create artifact directories | ||
|
||
- template: ./download-extract.yml | ||
parameters: | ||
name: 'CCache' | ||
artifactName: $(ccacheArtifactName) | ||
destinationFolder: $(ccacheDir) | ||
downloadPath: $(build.binariesDirectory) | ||
|
||
- ${{ if eq(parameters.swig, 'true') }}: | ||
- template: ./download-extract.yml | ||
parameters: | ||
name: 'LibShogun' | ||
artifactName: $(libshogunArtifactName) | ||
downloadPath: $(build.binariesDirectory) | ||
destinationFolder: $(targetPrefix) | ||
specificBuildWithTriggering: true | ||
|
||
- 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 -DCMAKE_INSTALL_PREFIX=/build/opt $(cmakeOptions) /src' | ||
detached: false | ||
|
||
- ${{ if ne(parameters.swig, 'true') }}: | ||
# some of the cpps are just requiring way too much memory | ||
- 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 shogun' | ||
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 -j3 -s all' | ||
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 ne(parameters.swig, 'true') }}: | ||
- template: ./archive-deploy.yml | ||
parameters: | ||
name: 'LibShogun' | ||
dir: $(targetPrefix) | ||
archive: $(libshogunArchive) | ||
artifactName: $(libshogunArtifactName) | ||
|
||
- template: ./archive-deploy.yml | ||
parameters: | ||
name: 'CCache' | ||
dir: $(ccacheDir) | ||
archive: $(ccacheArchive) | ||
artifactName: $(ccacheArtifactName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# NOTE: downloadPath and destinationFolder should not be the same! | ||
# as ExtractFiles will create destinationFolder that will result | ||
# in deleting anything in it, including the archive if downloadPath | ||
# is the same as destinationFolder | ||
parameters: | ||
artifactName: '' | ||
downloadPath: '' | ||
name: '' | ||
archiveFilePatterns: '' | ||
destinationFolder: '' | ||
specificBuildWithTriggering: false | ||
|
||
steps: | ||
- ${{ if eq(parameters.specificBuildWithTriggering, 'true') }}: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: ${{ format('Download {0} archive', parameters.name) }} | ||
continueOnError: true | ||
inputs: | ||
specificBuildWithTriggering: true | ||
artifactName: ${{ parameters.artifactName }} | ||
downloadPath: ${{ parameters.downloadPath }} | ||
|
||
|
||
- ${{ if ne(parameters.specificBuildWithTriggering, 'true') }}: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: ${{ format('Download {0} archive', parameters.name) }} | ||
continueOnError: true | ||
inputs: | ||
buildType: 'specific' | ||
project: $(System.TeamProjectId) | ||
pipeline: $(System.DefinitionId) | ||
buildVersionToDownload: "latest" | ||
artifactName: ${{ parameters.artifactName }} | ||
downloadPath: ${{ parameters.downloadPath }} | ||
|
||
- task: ExtractFiles@1 | ||
displayName: ${{ format('Extract {0} archive', parameters.name) }} | ||
condition: eq(variables['Agent.JobStatus'], 'Succeeded') | ||
inputs: | ||
archiveFilePatterns: ${{ format('{0}/{1}/*.tar', parameters.downloadPath, parameters.artifactName) }} | ||
destinationFolder: ${{ parameters.destinationFolder }} | ||
cleanDestinationFolder: True | ||
|
||
# FIXME: remove this hack, as it's only needed because DownloadBuildArtifacts | ||
# will not download artifact from jobs with SucceededWithIssues | ||
- script: | | ||
echo '##vso[task.setvariable variable=agent.jobstatus]Succeeded' | ||
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues') | ||
displayName: Set JobStatus to Succeeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
steps: | ||
- checkout: self | ||
clean: true | ||
fetchDepth: 5 | ||
submodules: true | ||
|
||
- script: mkdir $(ccacheDir) | ||
condition: | ||
displayName: Create CCache directory | ||
|
||
- template: ./download-extract.yml | ||
parameters: | ||
name: 'CCache' | ||
artifactName: $(ccacheArtifactName) | ||
destinationFolder: $(ccacheDir) | ||
downloadPath: $(build.binariesDirectory) | ||
|
||
- bash: | | ||
brew update | ||
brew install 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 | ||
env: | ||
CCACHE_DIR: $(ccacheDir) | ||
|
||
- script: ctest --output-on-failure -j 2 | ||
displayName: Test | ||
workingDirectory: build | ||
|
||
- template: ./archive-deploy.yml | ||
parameters: | ||
name: 'CCache' | ||
dir: $(ccacheDir) | ||
archive: $(ccacheArchive) | ||
artifactName: $(ccacheArtifactName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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% |
Oops, something went wrong.