|
| 1 | +# Copyright (c) Microsoft Corporation. |
| 2 | +# Licensed under the MIT License. |
| 3 | +# |
| 4 | +# https://go.microsoft.com/fwlink/?LinkId=248929 |
| 5 | + |
| 6 | +# Builds the SimpleMath module for Windows Subsystem for Linux (WSL) |
| 7 | + |
| 8 | +schedules: |
| 9 | +- cron: "30 3 * * *" |
| 10 | + displayName: 'Nightly build' |
| 11 | + branches: |
| 12 | + include: |
| 13 | + - main |
| 14 | + |
| 15 | +trigger: none |
| 16 | + |
| 17 | +pr: |
| 18 | + branches: |
| 19 | + include: |
| 20 | + - main |
| 21 | + paths: |
| 22 | + include: |
| 23 | + - CMake* |
| 24 | + - build/*.cmake |
| 25 | + - build/*.in |
| 26 | + - build/DirectXTK-GitHub-WSL-11.yml |
| 27 | + |
| 28 | +resources: |
| 29 | + repositories: |
| 30 | + - repository: self |
| 31 | + type: git |
| 32 | + ref: refs/heads/main |
| 33 | + trigger: none |
| 34 | + - repository: dxHeadersRepo |
| 35 | + name: Microsoft/DirectX-Headers |
| 36 | + type: github |
| 37 | + endpoint: microsoft |
| 38 | + ref: refs/heads/main |
| 39 | + - repository: dxMathRepo |
| 40 | + name: Microsoft/DirectXMath |
| 41 | + type: github |
| 42 | + endpoint: microsoft |
| 43 | + ref: refs/heads/main |
| 44 | + - repository: testRepo |
| 45 | + name: walbourn/directxtktest |
| 46 | + type: github |
| 47 | + endpoint: microsoft |
| 48 | + ref: refs/heads/main |
| 49 | + |
| 50 | +name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) |
| 51 | + |
| 52 | +pool: |
| 53 | + vmImage: ubuntu-24.04 |
| 54 | + |
| 55 | +variables: |
| 56 | + Codeql.Enabled: false |
| 57 | + LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/' |
| 58 | + |
| 59 | +jobs: |
| 60 | +- job: BUILD_SIMPLEMATH |
| 61 | + displayName: SimpleMath |
| 62 | + timeoutInMinutes: 120 |
| 63 | + cancelTimeoutInMinutes: 1 |
| 64 | + steps: |
| 65 | + - checkout: self |
| 66 | + clean: true |
| 67 | + fetchTags: false |
| 68 | + fetchDepth: 1 |
| 69 | + path: 's' |
| 70 | + - checkout: dxHeadersRepo |
| 71 | + displayName: Fetch DirectX-Headers |
| 72 | + clean: true |
| 73 | + fetchTags: false |
| 74 | + fetchDepth: 1 |
| 75 | + path: 's/DirectX-Headers' |
| 76 | + - checkout: dxMathRepo |
| 77 | + displayName: Fetch DirectX-Math |
| 78 | + clean: true |
| 79 | + fetchTags: false |
| 80 | + fetchDepth: 1 |
| 81 | + path: 's/DirectXMath' |
| 82 | + - checkout: testRepo |
| 83 | + displayName: Fetch Tests |
| 84 | + clean: true |
| 85 | + fetchTags: false |
| 86 | + fetchDepth: 1 |
| 87 | + path: 's/Tests' |
| 88 | + - task: CMake@1 |
| 89 | + displayName: CMake DirectX-Headers |
| 90 | + inputs: |
| 91 | + cwd: DirectX-Headers |
| 92 | + cmakeArgs: . -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) |
| 93 | + - task: CMake@1 |
| 94 | + displayName: CMake DirectX-Headers (Build) |
| 95 | + inputs: |
| 96 | + cwd: DirectX-Headers |
| 97 | + cmakeArgs: --build . -v |
| 98 | + - task: CMake@1 |
| 99 | + displayName: CMake DirectX-Headers (Install) |
| 100 | + inputs: |
| 101 | + cwd: DirectX-Headers |
| 102 | + cmakeArgs: --install . |
| 103 | + - task: CMake@1 |
| 104 | + displayName: CMake DirectXMath |
| 105 | + inputs: |
| 106 | + cwd: DirectXMath |
| 107 | + cmakeArgs: . -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) |
| 108 | + - task: CMake@1 |
| 109 | + displayName: CMake DirectXMath (Build) |
| 110 | + inputs: |
| 111 | + cwd: DirectXMath |
| 112 | + cmakeArgs: --build . -v |
| 113 | + - task: CMake@1 |
| 114 | + displayName: CMake DirectXMath (Install) |
| 115 | + inputs: |
| 116 | + cwd: DirectXMath |
| 117 | + cmakeArgs: --install . |
| 118 | + - task: PowerShell@2 |
| 119 | + displayName: Fetch SAL.H |
| 120 | + inputs: |
| 121 | + targetType: inline |
| 122 | + script: | |
| 123 | + $ProgressPreference = 'SilentlyContinue' |
| 124 | + Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/corert/master/src/Native/inc/unix/sal.h -OutFile $(LOCAL_PKG_DIR)/include/sal.h |
| 125 | + $fileHash = Get-FileHash -Algorithm SHA512 $(LOCAL_PKG_DIR)/include/sal.h | ForEach { $_.Hash} | Out-String |
| 126 | + $filehash = $fileHash.Trim() |
| 127 | + Write-Host "##[debug]SHA512: " $filehash |
| 128 | + if ($fileHash -ne "1643571673195d9eb892d2f2ac76eac7113ef7aa0ca116d79f3e4d3dc9df8a31600a9668b7e7678dfbe5a76906f9e0734ef8d6db0903ccc68fc742dd8238d8b0") { |
| 129 | + Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop |
| 130 | + } |
| 131 | +
|
| 132 | + - task: CMake@1 |
| 133 | + displayName: CMake SimpleMath (Config) dbg |
| 134 | + inputs: |
| 135 | + cwd: Tests/SimpleMathTest |
| 136 | + cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake |
| 137 | + - task: CMake@1 |
| 138 | + displayName: CMake SimpleMath (Build) dbg |
| 139 | + inputs: |
| 140 | + cwd: Tests/SimpleMathTest |
| 141 | + cmakeArgs: --build out -v |
| 142 | + - task: CMake@1 |
| 143 | + displayName: CMake SimpleMath (Config) rel |
| 144 | + inputs: |
| 145 | + cwd: Tests/SimpleMathTest |
| 146 | + cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake |
| 147 | + - task: CMake@1 |
| 148 | + displayName: CMake SimpleMath (Build) rel |
| 149 | + inputs: |
| 150 | + cwd: Tests/SimpleMathTest |
| 151 | + cmakeArgs: --build out2 -v |
| 152 | + - task: CmdLine@2 |
| 153 | + displayName: Run tests dbg |
| 154 | + inputs: |
| 155 | + script: ./out/bin/simplemathtest |
| 156 | + workingDirectory: Tests/SimpleMathTest |
| 157 | + - task: CmdLine@2 |
| 158 | + displayName: Run tests rel |
| 159 | + inputs: |
| 160 | + script: ./out2/bin/simplemathtest |
| 161 | + workingDirectory: Tests/SimpleMathTest |
0 commit comments