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)-$(use_mkl)
    destinationFolder: $(ccacheDir)
    downloadPath: $(build.binariesDirectory)

- bash: |
    sudo xcode-select --switch /Applications/Xcode_11.app/Contents/Developer
  displayName: Select XCode11 env

- bash: |
    brew update
    brew install ccache pkg-config arpack eigen glpk hdf5 lapack lzo nlopt snappy libomp spdlog rapidjson
  displayName: Install dependencies

- script: sudo $(CONDA)/bin/conda install mkl-devel -y -q
  condition: eq(variables['use_mkl'], 'true')
  displayName: Install MKL

- task: CMake@1
  displayName: Setup
  inputs:
    cmakeArgs: $(cmakeOptions) ..

- 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)-$(use_mkl)

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)-$(use_mkl)
    destinationFolder: $(ccacheDir)
    downloadPath: $(build.binariesDirectory)

- bash: |
    sudo xcode-select --switch /Applications/Xcode_12.app/Contents/Developer
  displayName: Select XCode12 env

- bash: |
    brew update
    brew install ccache pkg-config arpack eigen glpk hdf5 lapack lzo nlopt snappy libomp spdlog rapidjson
  displayName: Install dependencies

- script: sudo $(CONDA)/bin/conda install mkl-devel -y -q
  condition: eq(variables['use_mkl'], 'true')
  displayName: Install MKL

- task: CMake@1
  displayName: Setup
  inputs:
    cmakeArgs: $(cmakeOptions) ..

- 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)-$(use_mkl)

Update xcode version in macOS VM
Update xcode version in macOS VM

