-
Notifications
You must be signed in to change notification settings - Fork 219
179 lines (143 loc) · 4.95 KB
/
Build-And-Test.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Build and Test
on:
# Run a build on Pull Requests
pull_request:
branches: [ main ]
# Run this build every night
schedule:
- cron: "0 0 * * *"
# Run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
windows_vs_build:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v2
- name: Build MIDebugEngine
run: |
${{ github.workspace }}/eng/Scripts/CI-Build.cmd -c $env:Configuration -t vs
env:
Configuration: ${{ matrix.configuration }}
- name: Setup VSTest.console.exe
uses: darenm/Setup-VSTest@v1.3
- name: Run VS Extension tests
run: vstest.console.exe ${{ github.workspace }}\bin\${{ matrix.configuration }}\MICoreUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\JDbgUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\SSHDebugTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\MIDebugEngineUnitTests.dll
windows_vscode_build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v2
- name: Build MIDebugEngine
run: |
${{ github.workspace }}/eng/Scripts/CI-Build.cmd -t vscode
- name: Copy Test Configuration
run: |
copy ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\TestConfigurations\config_msys_gdb.xml ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\config.xml
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
update: true
install: >-
mingw-w64-x86_64-toolchain
- shell: msys2 {0}
name: Gather c++ toolchain paths
run: |
cygpath -w $(which g++)
g++ --version
cygpath -w $(which gdb)
gdb --version
- shell: msys2 {0}
name: Run tests
run: |
export CppTestsPath=$(cygpath -u "${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\CppTests.dll")
export ResultsPath=$(cygpath -u "${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\results.trx")
dotnet test $CppTestsPath --logger "trx;LogFileName=$ResultsPath"
- name: 'Upload Test Results'
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: win_msys2_x64_results
path: ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\results.trx
linux_build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build ${{ github.workspace }}/src/MIDebugEngine-Unix.sln
- run: |
sudo apt update
sudo apt-get install gdb g++ -y
which g++
which gdb
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
# TODO: Try to make core dumps work
# Related CoreDump Tests: https://github.com/microsoft/MIEngine/issues/1170
# echo 1 | sudo tee /proc/sys/kernel/core_uses_pid
# ulimit -S -c unlimited
# sudo sysctl -w kernel.core_pattern=${{ github.workspace }}/core.%e
- run: |
${{ github.workspace }}/eng/Scripts/CI-Build.sh
- run: |
${{ github.workspace }}/eng/Scripts/CI-Test.sh
- name: 'Upload Test Results'
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: linux_x64_results
path: ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx
osx_build:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build ${{ github.workspace }}/src/MIDebugEngine-Unix.sln
- run: |
${{ github.workspace }}/eng/Scripts/CI-Build.sh
- run: |
${{ github.workspace }}/eng/Scripts/CI-Test.sh
- name: 'Upload Test Results'
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: osx_x64_results
path: ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx