Skip to content

Commit

Permalink
add windows c# ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Jan 9, 2019
1 parent 8b4103d commit b212a4c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 7 deletions.
36 changes: 34 additions & 2 deletions .ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
steps:
- template: ./macos-steps.yml

- job: windows
- job: windows_libshogun
displayName: Windows
timeoutInMinutes: 120

Expand All @@ -151,13 +151,45 @@ jobs:
py36:
CONDA_PY: "36"
CONDA_ENV: shogun
cmakeOptions: '-DBUILD_META_EXAMPLES=OFF'

variables:
clcacheDir: 'C:\\Users\\VssAdministrator\\clcache'
clcacheArtifactName: 'clcache-vs17'
clcacheArchive: '$(Build.ArtifactStagingDirectory)/clache-$(Build.BuildId).tar.gz'
clcacheArchive: '$(Build.ArtifactStagingDirectory)/clcache-$(Build.BuildId).tar.gz'
libshogunArtifactName: 'libshogun-vs17'
libshogunArchive: '$(Build.ArtifactStagingDirectory)/libshogun-$(Build.BuildId).tar.gz'
targetPrefix: '$(build.binariesDirectory)\\opt'
buildConfiguration: Release
buildPlatform: x64

steps:
- template: ./windows-steps.yml

- job: windows_swig
displayName: Windows SWIG Interface
dependsOn: windows_libshogun
timeoutInMinutes: 120

pool:
vmImage: 'vs2017-win2016'

strategy:
matrix:
csharp:
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_CSHARP=ON'
interfaceName: 'csharp'

variables:
targetPrefix: '$(build.binariesDirectory)\\opt'
libshogunArtifactName: 'libshogun-vs17'
libshogunArchive: '$(Build.ArtifactStagingDirectory)/libshogun-$(Build.BuildId).tar.gz'
commonSWIGCMakeFlags: '-DLIBSHOGUN=OFF -DDISABLE_UNIT_TESTS=ON -DDISABLE_META_CPP=ON'
clcacheDir: 'C:\\Users\\VssAdministrator\\clcache'
clcacheArtifactName: 'clcache-$(interfaceName)'
clcacheArchive: '$(Build.ArtifactStagingDirectory)/clcache-$(Build.BuildId).tar.gz'

steps:
- template: ./windows-steps.yml
parameters:
swig: true
1 change: 0 additions & 1 deletion .ci/docker-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ steps:
submodules: true

- script: mkdir $(ccacheDir) $(targetPrefix)
condition:
displayName: Create artifact directories

- template: ./download-extract.yml
Expand Down
32 changes: 28 additions & 4 deletions .ci/windows-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,37 @@ steps:
inputs:
createCustomEnvironment: True
environmentName: shogun
packageSpecs: 'python=3.6.* setuptools numpy scipy eigen rxcpp snappy zlib ctags ply jinja2 gtest mkl-devel'
packageSpecs: 'python=3.6.* setuptools numpy scipy eigen rxcpp snappy zlib ctags ply jinja2 gtest mkl-devel swig'
createOptions: '-c conda-forge'
updateConda: false

- script: |
.ci\\setup_clcache.cmd
displayName: Setup CLCache

- script: mkdir $(targetPrefix)
displayName: Create artifact directory

- template: ./download-extract.yml
parameters:
name: 'CLcache'
artifactName: $(clcacheArtifactName)
destinationFolder: $(clcacheDir)
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: CMake@1
displayName: Setup
inputs:
cmakeArgs: '-G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=$(buildConfiguration) -DCMAKE_INSTALL_PREFIX=$(CONDA_PREFIX)\Library -DBUILD_META_EXAMPLES=OFF -DENABLE_TESTING=ON ..'
cmakeArgs: '-G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=$(buildConfiguration) -DCMAKE_PREFIX_PATH=$(CONDA_PREFIX)\Library -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=$(targetPrefix) $(cmakeOptions) ..'

- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) $(buildPlatform))'
Expand All @@ -39,13 +51,25 @@ steps:
msbuildArgs: '/p:TrackFileAccess=false /p:CLToolExe=clcache.exe'
configuration: $(buildConfiguration)

- script: ctest -j%NUMBER_OF_PROCESSORS% -C $(buildConfiguration)
- script: cmake --build . --config $(buildConfiguration) --target INSTALL
displayName: Install
workingDirectory: $(build.binariesDirectory)

- script: ctest -j 2
displayName: Test
workingDirectory: build
workingDirectory: $(build.binariesDirectory)

- script: clcache -s
displayName: CLCache statistics

- ${{ if ne(parameters.swig, 'true') }}:
- template: ./archive-deploy.yml
parameters:
name: 'LibShogun'
dir: $(targetPrefix)
archive: $(libshogunArchive)
artifactName: $(libshogunArtifactName)

- template: ./archive-deploy.yml
parameters:
name: 'CLcache'
Expand Down

0 comments on commit b212a4c

Please sign in to comment.