diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa91291..3a060f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,17 +3,44 @@ # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml +# Kick off build just on master branch. trigger: - master -pool: - vmImage: 'ubuntu-latest' +variables: + CONDA_ENV_NAME: test_env -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' - -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' +jobs: +# Linux build. +- job: Linux + displayName: 'Run workshops build on Linux' + pool: + vmImage: 'ubuntu-16.04' + steps: + # 1) Add conda to path. + - bash: echo "##vso[task.prependpath]$CONDA/bin" + # 2) Create conda environment based on checked in yaml file. + # 3) Activate created environment. + # 4) Build using make. + - script: | + conda env create --quiet --file workshops/environment.yml --name $(CONDA_ENV_NAME) + source activate $(CONDA_ENV_NAME) + make --directory workshops +# Windows build. +- job: Windows + displayName: 'Run workshops build on Windows' + pool: + vmImage: 'vs2017-win2016' + steps: + # 1) Add conda to path. + - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" + # 2) Create conda environment based on checked in yaml file. + # 3) Activate created environment. + # 4) Figure out msbuild location using vswhere unitility (install it using chocolatey). + # 5) Build using msbuild. + - script: | + conda env create --quiet --file workshops/environment.yml --name $(CONDA_ENV_NAME) + call activate $(CONDA_ENV_NAME) + choco install vswhere + for /f "tokens=*" %%i in ('vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe -nologo') do set msbuildpath="%%i" + call %msbuildpath% workshops\workshops.sln /p:Platform="Any CPU";Configuration=Debug diff --git a/workshops/Makefile b/workshops/Makefile index 4868196..09d5bb2 100644 --- a/workshops/Makefile +++ b/workshops/Makefile @@ -4,7 +4,7 @@ WORKSHOPS := nn_backprop conv_nets all: # Loop over all workshops and build them. $(foreach WORKSHOP, $(WORKSHOPS), \ - @echo --------- BUILDING WORKSHOP $(WORKSHOP) -------------- ; \ + echo --------- BUILDING WORKSHOP $(WORKSHOP) -------------- ; \ make --directory=$(WORKSHOP) WORKSHOP=$(WORKSHOP) all; \ if [ $$? -eq 0 ]; then \ echo --------- BUILDING WORKSHOP $(WORKSHOP) SUCCESS ------; \ diff --git a/workshops/common.props b/workshops/common.props index 338d7b1..17b45c0 100644 --- a/workshops/common.props +++ b/workshops/common.props @@ -3,7 +3,7 @@ $(SolutionDir)\build $(SolutionDir)\build_scripts - C:\ProgramData\Anaconda3\ + \ No newline at end of file diff --git a/workshops/common.targets b/workshops/common.targets index 98e715d..8c7a467 100644 --- a/workshops/common.targets +++ b/workshops/common.targets @@ -1,9 +1,24 @@ - + + + + + + + Text="Python.exe not found. Please set PythonPath property to parent dir of python.exe (including trailing \) or install and add Python to path." + Condition="'$(ExecExitCode)'=='9009' And '$(PythonPath)'==''"/> + + + python.exe + + + $(PythonPath)python.exe + + + + @@ -16,7 +31,7 @@ Text="No files found with Pynb attribute. Please read the readme for workshop creation to find info on how to fix this." /> - + \ No newline at end of file