Skip to content

Commit 8a4ff71

Browse files
authored
Add GitHub Action for BVTs with subset of tests (#522)
1 parent cbcabd9 commit 8a4ff71

16 files changed

+626
-433
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ updates:
33
- package-ecosystem: github-actions
44
directory: /
55
schedule:
6-
interval: daily
6+
interval: weekly

.github/workflows/bvt.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33
#
4-
# http://go.microsoft.com/fwlink/?LinkId=248926
4+
# https://go.microsoft.com/fwlink/?LinkId=248926
55

66
name: 'CTest (Windows)'
77

@@ -125,7 +125,7 @@ jobs:
125125
with:
126126
runVcpkgInstall: true
127127
vcpkgJsonGlob: '**/build/vcpkg.json'
128-
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
128+
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}'
129129

130130
- name: 'Configure CMake'
131131
working-directory: ${{ github.workspace }}

.github/workflows/vcpkg.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33
#
4-
# http://go.microsoft.com/fwlink/?LinkId=248926
4+
# https://go.microsoft.com/fwlink/?LinkId=248926
55

66
name: 'CMake (Windows using VCPKG)'
77

@@ -81,7 +81,7 @@ jobs:
8181
with:
8282
runVcpkgInstall: true
8383
vcpkgJsonGlob: '**/build/vcpkg.json'
84-
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
84+
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}'
8585

8686
- name: 'Configure CMake'
8787
working-directory: ${{ github.workspace }}

.github/workflows/wsl.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33
#
4-
# http://go.microsoft.com/fwlink/?LinkId=248926
4+
# https://go.microsoft.com/fwlink/?LinkId=248926
55

66
name: 'CMake (WSL)'
77

@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
runVcpkgInstall: true
4343
vcpkgJsonGlob: '**/build/vcpkg.json'
44-
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
44+
vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}'
4545

4646
- name: 'Configure CMake'
4747
working-directory: ${{ github.workspace }}

CMakeLists.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,16 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
605605
target_compile_options(${t} PRIVATE ${WarningsEXE})
606606
endforeach()
607607

608-
if(BUILD_FUZZING
609-
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32)
610-
AND (NOT WINDOWS_STORE))
611-
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
612-
target_compile_options(${t} PRIVATE ${ASAN_SWITCHES})
613-
target_link_libraries(${t} PRIVATE ${ASAN_LIBS})
614-
endforeach()
608+
if(BUILD_FUZZING AND (NOT WINDOWS_STORE))
609+
string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
610+
string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
611+
612+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32)
613+
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
614+
target_compile_options(${t} PRIVATE ${ASAN_SWITCHES})
615+
target_link_libraries(${t} PRIVATE ${ASAN_LIBS})
616+
endforeach()
617+
endif()
615618
endif()
616619
endif()
617620

0 commit comments

Comments
 (0)