parameters:
  mode: 'debug'
  sanitize: ''

jobs:
  - job: 'macOS_${{ parameters.mode }}'
    displayName: 'macOS (${{ parameters.mode }})'

    variables:
    - name: CCACHE_DIR
      value: $(Build.SourcesDirectory)/ccache

    pool:
      vmImage: macOS-11

    steps:
    - script: |
        brew install ccache
      displayName: 'Dependencies'

    - template: setup.yml

    - template: cache.yml
      parameters:
        mode: ${{ parameters.mode }}

    - script: |
        echo "##vso[task.setvariable variable=config]mode=${{ parameters.mode }} sanitize=${{ parameters.sanitize }} XCODE=/Applications/Xcode_13.0.app/Contents/Developer"
      displayName: 'Configure'

    - ${{ if eq(parameters.mode, 'debug') }}:
      - script: |
          make -j $(sysctl -n hw.ncpu) $(config) tests
        displayName: 'Test'

    - ${{ if eq(parameters.mode, 'release') }}:
      - script: |
          make -j $(sysctl -n hw.ncpu) $(config) libfly
        displayName: 'Build'

      - template: package.yml
        parameters:
          contents: 'build/release/clang/x64/etc/libfly-*.tar.bz2'

parameters:
  mode: 'debug'
  sanitize: ''

jobs:
  - job: 'macOS_${{ parameters.mode }}'
    displayName: 'macOS (${{ parameters.mode }})'

    variables:
    - name: CCACHE_DIR
      value: $(Build.SourcesDirectory)/ccache

    pool:
      vmImage: macOS-11

    steps:
    - script: |
        brew install ccache
      displayName: 'Dependencies'

    - template: setup.yml

    - template: cache.yml
      parameters:
        mode: ${{ parameters.mode }}

    - script: |
        echo "##vso[task.setvariable variable=config]mode=${{ parameters.mode }} sanitize=${{ parameters.sanitize }}"
      displayName: 'Configure'

    - ${{ if eq(parameters.mode, 'debug') }}:
      - script: |
          make -j $(sysctl -n hw.ncpu) $(config) tests
        displayName: 'Test'

    - ${{ if eq(parameters.mode, 'release') }}:
      - script: |
          make -j $(sysctl -n hw.ncpu) $(config) libfly
        displayName: 'Build'

      - template: package.yml
        parameters:
          contents: 'build/release/clang/x64/etc/libfly-*.tar.bz2'

Use default Xcode version on macOS CI
Use default Xcode version on macOS CI

At one point, Xcode 13 wasn't the default.
