-
Notifications
You must be signed in to change notification settings - Fork 22
148 lines (123 loc) · 5.36 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: MSBuild
on: pull_request
concurrency:
# Cancel any builds currently in progress for the same PR.
# Allow running concurrently for with any other commits.
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build-vs:
timeout-minutes: 15
strategy:
matrix:
configurations: [Debug, Release]
runs-on: windows-2022
env:
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: ${{matrix.configurations}}
BUILD_PLATFORM: x64
CXPLAT_MEMORY_LEAK_DETECTION: true
DUMP_PATH: c:/dumps/x64/${{matrix.configurations}}
TEST_TIMEOUT: 900 # 15 minute timeout for tests.
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Generate Catch2 projects
working-directory: ${{env.GITHUB_WORKSPACE}}
run: cmake -G "Visual Studio 17 2022" -S external\catch2 -B external\catch2\build -DBUILD_TESTING=OFF
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} /p:RunCodeAnalysis='True' ${{env.SOLUTION_FILE_PATH}}
- name: Run cxplat tests without fault injection
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION }}
shell: cmd
run: |
.\cxplat_test -d yes
- name: Run usersim tests without fault injection
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION }}
shell: cmd
run: |
.\usersim_tests -d yes
- name: Run cxplat tests with fault injection
if: matrix.configurations == 'Debug'
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION }}
shell: cmd
run: |
powershell ..\..\scripts\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ".\cxplat_test.exe" 4
- name: Run usersim tests with fault injection
if: matrix.configurations == 'Debug'
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION }}
shell: cmd
run: |
powershell ..\..\scripts\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ".\usersim_tests.exe" 4
build-cmake:
timeout-minutes: 15
strategy:
matrix:
configurations: [Debug, Release]
runs-on: windows-2022
env:
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: ${{matrix.configurations}}
BUILD_PLATFORM: x64
CMAKE_GENERATOR: Visual Studio 17 2022
PLATFORM_TOOLSET: v143
CXPLAT_MEMORY_LEAK_DETECTION: true
DUMP_PATH: c:/dumps/x64/${{matrix.configurations}}
TEST_TIMEOUT: 900 # 15 minute timeout for tests.
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Configure the project
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
cmake -G "Visual Studio 17 2022" -S external\catch2 -B external\catch2\build -DBUILD_TESTING=OFF
cmake -S . -B build -G "${{env.CMAKE_GENERATOR}}" -A ${{env.BUILD_PLATFORM}} -T ${{env.PLATFORM_TOOLSET}}
- name: Build the project
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
cmake --build build --config ${{env.BUILD_CONFIGURATION }}
- name: Run cxplat tests without fault injection
working-directory: ./build/bin/${{env.BUILD_CONFIGURATION}}
shell: cmd
run: |
.\cxplat_test -d yes
- name: Run usersim tests without fault injection
working-directory: ./build/bin/${{env.BUILD_CONFIGURATION}}
shell: cmd
run: |
.\usersim_tests -d yes
- name: Run cxplat tests with fault injection
if: matrix.configurations == 'Debug'
working-directory: ./build/bin/${{env.BUILD_CONFIGURATION}}
shell: cmd
run: |
powershell ..\..\..\scripts\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ".\cxplat_test.exe" 4
- name: Run usersim tests with fault injection
if: matrix.configurations == 'Debug'
working-directory: ./build/bin/${{env.BUILD_CONFIGURATION}}
shell: cmd
run: |
powershell ..\..\..\scripts\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ".\usersim_tests.exe" 4