Skip to content

Commit d3e5160

Browse files
committed
ci(windows): optionally test windows with ASAN
Add the label `ci:windows-asan` to enable it.
1 parent ca6dbf3 commit d3e5160

File tree

5 files changed

+83
-60
lines changed

5 files changed

+83
-60
lines changed

Diff for: .github/workflows/optional.yml

+7
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ jobs:
4646
runuser -u qemuci -- cmake -B build -G Ninja -D CI_BUILD=ON -D PREFER_LUA=ON &&
4747
runuser -u qemuci -- make ${{ matrix.test }}
4848
"
49+
50+
windows-asan:
51+
if: contains(github.event.pull_request.labels.*.name, 'ci:windows-asan') || github.event_name == 'workflow_dispatch'
52+
uses: ./.github/workflows/test_windows.yml
53+
with:
54+
build_flags: "-D ENABLE_ASAN_UBSAN=ON"
55+
functionaltest_timeout: 40

Diff for: .github/workflows/test.yml

+1-59
Original file line numberDiff line numberDiff line change
@@ -193,65 +193,7 @@ jobs:
193193
run: cat $(find "$LOG_DIR" -type f)
194194

195195
windows:
196-
runs-on: windows-2022
197-
timeout-minutes: 45
198-
strategy:
199-
fail-fast: false
200-
matrix:
201-
test: [functional, old]
202-
steps:
203-
- uses: actions/checkout@v4
204-
- uses: ./.github/actions/setup
205-
206-
- name: Build deps
207-
run: |
208-
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
209-
cmake --build .deps
210-
211-
- name: Build
212-
run: |
213-
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo'
214-
cmake --build build
215-
216-
- name: Install test deps
217-
run: |
218-
$PSNativeCommandArgumentPassing = 'Legacy'
219-
220-
& build\bin\nvim.exe "--version"
221-
222-
# Ensure that the "win32" feature is set.
223-
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
224-
225-
python -m pip install pynvim
226-
# Sanity check
227-
python -c "import pynvim; print(str(pynvim))"
228-
229-
node --version
230-
npm.cmd --version
231-
232-
npm.cmd install -g neovim
233-
Get-Command -CommandType Application neovim-node-host.cmd
234-
npm.cmd link neovim
235-
236-
- if: ${{ matrix.test == 'functional' }}
237-
name: functionaltest
238-
timeout-minutes: 20
239-
run: cmake --build build --target functionaltest
240-
241-
- if: ${{ matrix.test == 'old' }}
242-
uses: msys2/setup-msys2@v2
243-
with:
244-
update: true
245-
pacboy: >-
246-
make:p gcc:p diffutils:p
247-
release: false
248-
249-
- if: ${{ matrix.test == 'old' }}
250-
name: oldtest
251-
shell: msys2 {0}
252-
run: |
253-
cd test/old/testdir
254-
mingw32-make VERBOSE=1
196+
uses: ./.github/workflows/test_windows.yml
255197

256198
# This job tests the following things:
257199
# - Check if Release, MinSizeRel and RelWithDebInfo compiles correctly.

Diff for: .github/workflows/test_windows.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: windows
2+
on:
3+
workflow_call:
4+
inputs:
5+
build_flags:
6+
type: string
7+
functionaltest_timeout:
8+
default: 20
9+
type: number
10+
11+
jobs:
12+
windows:
13+
runs-on: windows-2022
14+
timeout-minutes: 45
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
test: [functional, old]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: ./.github/actions/setup
22+
23+
- name: Build deps
24+
run: |
25+
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
26+
cmake --build .deps
27+
28+
- name: Build
29+
run: |
30+
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' ${{ inputs.build_flags }}
31+
cmake --build build
32+
33+
- name: Install test deps
34+
run: |
35+
$PSNativeCommandArgumentPassing = 'Legacy'
36+
37+
& build\bin\nvim.exe "--version"
38+
39+
# Ensure that the "win32" feature is set.
40+
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
41+
42+
python -m pip install pynvim
43+
# Sanity check
44+
python -c "import pynvim; print(str(pynvim))"
45+
46+
node --version
47+
npm.cmd --version
48+
49+
npm.cmd install -g neovim
50+
Get-Command -CommandType Application neovim-node-host.cmd
51+
npm.cmd link neovim
52+
53+
- if: ${{ matrix.test == 'functional' }}
54+
name: functionaltest
55+
timeout-minutes: ${{ inputs.functionaltest_timeout }}
56+
run: cmake --build build --target functionaltest
57+
58+
- if: ${{ matrix.test == 'old' }}
59+
uses: msys2/setup-msys2@v2
60+
with:
61+
update: true
62+
pacboy: >-
63+
make:p gcc:p diffutils:p
64+
release: false
65+
66+
- if: ${{ matrix.test == 'old' }}
67+
name: oldtest
68+
shell: msys2 {0}
69+
run: |
70+
cd test/old/testdir
71+
mingw32-make VERBOSE=1

Diff for: MAINTAIN.md

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ Some github labels are used to trigger certain jobs:
232232
* `backport release-x.y` - backport to release branch
233233
* `ci:s390x` - enable s390x CI
234234
* `ci:skip-news` - skip news.yml workflows
235+
* `ci:windows-asan` - test windows with ASAN enabled
235236
* `needs:response` - close PR after a certain amount of time if author doesn't
236237
respond
237238

Diff for: src/nvim/main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include <string.h>
1515
#ifdef ENABLE_ASAN_UBSAN
1616
# include <sanitizer/asan_interface.h>
17-
# include <sanitizer/ubsan_interface.h>
17+
# ifndef MSWIN
18+
# include <sanitizer/ubsan_interface.h>
19+
# endif
1820
#endif
1921

2022
#include "auto/config.h" // IWYU pragma: keep

0 commit comments

Comments
 (0)