|
| 1 | +# Copyright (c) Microsoft Corporation. |
| 2 | +# Licensed under the MIT License. |
| 3 | +# |
| 4 | +# https://go.microsoft.com/fwlink/?LinkId=248926 |
| 5 | + |
| 6 | +name: 'CTest (BVTs)' |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: [ "main" ] |
| 11 | + pull_request: |
| 12 | + branches: [ "main" ] |
| 13 | + paths-ignore: |
| 14 | + - '*.md' |
| 15 | + - LICENSE |
| 16 | + - '.nuget/*' |
| 17 | + - build/*.cmd |
| 18 | + - build/*.json |
| 19 | + - build/*.props |
| 20 | + - build/*.ps1 |
| 21 | + - build/*.targets |
| 22 | + - build/*.yml |
| 23 | + |
| 24 | +permissions: |
| 25 | + contents: read |
| 26 | + |
| 27 | +jobs: |
| 28 | + build: |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + timeout-minutes: 60 |
| 31 | + |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + |
| 35 | + matrix: |
| 36 | + os: [windows-2019, windows-2022] |
| 37 | + build_type: [x64-Release] |
| 38 | + arch: [amd64] |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
| 42 | + |
| 43 | + - name: Clone test repository |
| 44 | + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
| 45 | + with: |
| 46 | + repository: walbourn/directxtextest |
| 47 | + path: Tests |
| 48 | + ref: main |
| 49 | + |
| 50 | + - name: 'Install Ninja' |
| 51 | + run: choco install ninja |
| 52 | + |
| 53 | + - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 |
| 54 | + with: |
| 55 | + arch: ${{ matrix.arch }} |
| 56 | + |
| 57 | + - name: 'Set triplet' |
| 58 | + shell: pwsh |
| 59 | + run: | |
| 60 | + if ("${{ matrix.arch }}" -eq "amd64") |
| 61 | + { |
| 62 | + echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV |
| 63 | + } |
| 64 | + elseif ("${{ matrix.arch }}" -eq "amd64_x86") |
| 65 | + { |
| 66 | + echo "VCPKG_DEFAULT_TRIPLET=x86-windows" >> $env:GITHUB_ENV |
| 67 | + } |
| 68 | + elseif ("${{ matrix.arch }}" -eq "amd64_arm64") |
| 69 | + { |
| 70 | + if ("${{ matrix.build_type }}" -match "^arm64ec") |
| 71 | + { |
| 72 | + echo "VCPKG_DEFAULT_TRIPLET=arm64ec-windows" >> $env:GITHUB_ENV |
| 73 | + } |
| 74 | + else |
| 75 | + { |
| 76 | + echo "VCPKG_DEFAULT_TRIPLET=arm64-windows" >> $env:GITHUB_ENV |
| 77 | + } |
| 78 | + } |
| 79 | + else |
| 80 | + { |
| 81 | + echo "::error Unknown architecture/build-type triplet mapping" |
| 82 | + } |
| 83 | +
|
| 84 | + - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 |
| 85 | + with: |
| 86 | + runVcpkgInstall: true |
| 87 | + vcpkgJsonGlob: '**/build/vcpkg.json' |
| 88 | + vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' |
| 89 | + |
| 90 | + - name: 'Configure CMake' |
| 91 | + working-directory: ${{ github.workspace }} |
| 92 | + run: > |
| 93 | + cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF -DBUILD_BVT=ON |
| 94 | + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" |
| 95 | + -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" |
| 96 | +
|
| 97 | + - name: 'Build' |
| 98 | + working-directory: ${{ github.workspace }} |
| 99 | + run: cmake --build out\build\${{ matrix.build_type }} |
| 100 | + |
| 101 | + - name: 'Run BVTs' |
| 102 | + working-directory: ${{ github.workspace }} |
| 103 | + run: ctest --preset=${{ matrix.build_type }} --output-on-failure |
0 commit comments