Skip to content

Commit 7e798dc

Browse files
committed
github: test Ninja builds.
1 parent a138af5 commit 7e798dc

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
jobs:
1717
build-linux:
1818
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
generator: ["Unix Makefiles", Ninja]
24+
1925
steps:
2026
# Install latest CMake.
2127
- uses: lukka/get-cmake@latest
@@ -30,7 +36,7 @@ jobs:
3036
- name: CMake
3137
run: |
3238
mkdir cbuild
33-
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE
39+
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}"
3440
cmake --build cbuild/
3541
3642
- uses: ruby/setup-ruby@v1
@@ -56,6 +62,12 @@ jobs:
5662
build-windows:
5763
# Because we want to use Visual Studio 16 2019, we need to use the windows-2019 GitHub runner
5864
runs-on: windows-2019
65+
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
generator: ["Visual Studio 16 2019", Ninja]
70+
5971
steps:
6072
# Install latest CMake.
6173
- uses: lukka/get-cmake@latest
@@ -64,14 +76,19 @@ jobs:
6476
with:
6577
submodules: recursive
6678

79+
- name: Add cl.exe to PATH
80+
uses: ilammy/msvc-dev-cmd@v1
81+
with:
82+
arch: amd64
83+
6784
- name: CMake
6885
run: |
6986
# make a build directory (note: build is already used by Crashpad)
7087
mkdir cbuild
7188
7289
# run CMake (additional options like -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE are possible)
7390
# it is recommended to specify the compiler version used for the build
74-
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "Visual Studio 16 2019"
91+
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}" -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe
7592
cmake --build cbuild/
7693
7794
- uses: ruby/setup-ruby@v1
@@ -101,6 +118,7 @@ jobs:
101118
fail-fast: false
102119
matrix:
103120
arch: [arm64, x86_64]
121+
generator: ["Unix Makefiles", Ninja]
104122

105123
steps:
106124
# Install latest CMake.
@@ -113,7 +131,7 @@ jobs:
113131
- name: CMake
114132
run: |
115133
mkdir cbuild
116-
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
134+
cmake -S . -B cbuild/ -DBUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -G "${{ matrix.generator }}"
117135
cmake --build cbuild/
118136
119137
- uses: ruby/setup-ruby@v1

backtrace/save_artifacts.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def gather_binaries dir = binary_dir
8585
[ 'handler\Debug\handler.exe', 'bin/handler.exe' ],
8686
[ './client/Release/client.lib', 'bin/client.lib' ],
8787
[ 'handler\Release\handler.exe', 'bin/handler.exe' ],
88+
[ './client/client.lib', 'bin/client.lib' ],
89+
[ 'handler\handler.exe', 'bin/handler.exe' ],
8890
]
8991
Dir.chdir dir do
9092
files.each do |file, name|

backtrace/test/crashpad_utils.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ def execute tmp_dir: nil
117117

118118
def handler
119119
if OS.windows?
120-
'handler/Debug/handler.exe'
120+
[
121+
'handler/Debug/handler.exe',
122+
'handler/Release/handler.exe',
123+
'handler/handler.exe',
124+
].find { |f| File.exist? f }
121125
else
122126
'handler/handler'
123127
end

backtrace/test/test_windows.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
require_relative 'crashpad_utils'
44

5-
class TestLinux < Minitest::Test
5+
class TestWindows < Minitest::Test
66
def test_crashpad_uploads
7-
result = Crashpad::perform_test executable: 'examples/windows/demo/Debug/demo_windows.exe'
7+
exe = if File.exist?("#{__dir__}/../../cbuild/examples/windows/demo/Debug/demo_windows.exe")
8+
'examples/windows/demo/Debug/demo_windows.exe'
9+
else
10+
'examples/windows/demo/demo_windows.exe'
11+
end
12+
Dir["#{__dir__}/../../cbuild/examples/windows/demo/**/*"].each do |file|
13+
p file
14+
end
15+
result = Crashpad::perform_test executable: exe
816
assert result
917
assert result.has_key? :upload
1018

0 commit comments

Comments
 (0)