# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkID=615560

# Builds the math3 test suite for DirectXMath.

schedules:
- cron: "0 0 * * *"
  displayName: 'Nightly build'
  branches:
    include:
    - main

trigger:
  branches:
    include:
    - main
  paths:
    exclude:
    - README.md
    - HISTORY.md
    - SECURITY.md
    - LICENSE
pr:
  branches:
    include:
    - main
  paths:
    exclude:
    - README.md
    - HISTORY.md
    - SECURITY.md
    - LICENSE
  drafts: false

resources:
  repositories:
  - repository: self
    type: git
    ref: refs/heads/main

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

variables:
  GITHUB_PAT: $(GITHUBPUBLICTOKEN)
  Codeql.Enabled: true

pool:
  vmImage: windows-2019

jobs:
- job: BUILD_DEV16
  displayName: 'Visual Studio 2019 (v142)'
  cancelTimeoutInMinutes: 1
  steps:
  - checkout: self
    clean: true
    fetchTags: false
  - task: DeleteFiles@1
    displayName: Delete files from Tests
    inputs:
      SourceFolder: Tests
      Contents: '**'
      RemoveSourceFolder: true
      RemoveDotFiles: true
  - task: CmdLine@2
    displayName: Fetch Tests
    inputs:
      script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmathtest.git Tests
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln arm64dbg
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln arm64rel
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg sse3
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE3 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel sse3
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE3 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg sse3
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE3 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel sse3
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE3 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg sse4
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE4 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel sse4
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE4 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg sse4
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE4 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel sse4
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE4 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg avx
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel avx
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg avx
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel avx
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg avx2
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX2 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel avx2
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX2 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg avx2
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX2 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel avx2
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX2 Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: NI Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: NI Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64dbg nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: NI Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x64rel nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: NI Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln arm64dbg nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: NI Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln arm86rel nointrinsics
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: NI Release
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86dbg x87
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: x87 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2019.sln x86rel x87
    inputs:
      solution: Tests/math3/math3_2019.sln
      vsVersion: 16.0
      platform: x86
      configuration: x87 Release
  - task: VSBuild@1
    displayName: Build solution shmath_2019.sln x64dbg
    inputs:
      solution: Tests/shmath/shmath_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution shmath_2019.sln x64rel
    inputs:
      solution: Tests/shmath/shmath_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution shmath_2019.sln arm64dbg
    inputs:
      solution: Tests/shmath/shmath_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution shmath_2019.sln arm64rel
    inputs:
      solution: Tests/shmath/shmath_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2019 x64dbg
    inputs:
      solution: Tests/xdsp/XDSPTest_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2019 x64rel
    inputs:
      solution: Tests/xdsp/XDSPTest_2019.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2019 arm64dbg
    inputs:
      solution: Tests/xdsp/XDSPTest_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2019 arm64rel
    inputs:
      solution: Tests/xdsp/XDSPTest_2019.sln
      vsVersion: 16.0
      platform: ARM64
      configuration: Release

- job: BUILD_DEV15
  displayName: 'Visual Studio 2019 (v141)'
  steps:
  - checkout: self
    clean: true
    fetchTags: false
  - task: CmdLine@2
    displayName: Fetch Tests
    inputs:
      script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmathtest.git Tests
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg sse3
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE3 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel sse3
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE3 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg sse3
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE3 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel sse3
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE3 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg sse4
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE4 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel sse4
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: SSE4 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg sse4
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE4 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel sse4
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: SSE4 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg avx
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel avx
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg avx
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel avx
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg avx2
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX2 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel avx2
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: AVX2 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg avx2
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX2 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel avx2
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: AVX2 Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg nointrinsics
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: NI Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel nointrinsics
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: NI Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64dbg nointrinsics
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: NI Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x64rel nointrinsics
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: NI Release
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86dbg x87
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: x87 Debug
  - task: VSBuild@1
    displayName: Build solution math3_2017.sln x86rel x87
    inputs:
      solution: Tests/math3/math3_2017.sln
      vsVersion: 16.0
      platform: x86
      configuration: x87 Release
  - task: VSBuild@1
    displayName: Build solution shmath_2017.sln x64dbg
    inputs:
      solution: Tests/shmath/shmath_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution shmath_2017.sln x64rel
    inputs:
      solution: Tests/shmath/shmath_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2017 x64dbg
    inputs:
      solution: Tests/xdsp/XDSPTest_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Debug
  - task: VSBuild@1
    displayName: Build solution XDSPTest_2017 x64rel
    inputs:
      solution: Tests/xdsp/XDSPTest_2017.sln
      vsVersion: 16.0
      platform: x64
      configuration: Release
