Repository navigation
61 lines (57 loc) · 2.29 KB
/
Copy pathwindows_ffi_memory.yml
File metadata and controls
61 lines (57 loc) · 2.29 KB
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
name: Windows FFI memory ownership
on:
push:
branches: [windows-worker-thread-lazy-library]
paths:
- 'flutter_local_notifications_windows/src/**'
- 'flutter_local_notifications_windows/test/native/**'
- '.github/workflows/windows_ffi_memory.yml'
pull_request:
paths:
- 'flutter_local_notifications_windows/src/**'
- 'flutter_local_notifications_windows/test/native/**'
- '.github/workflows/windows_ffi_memory.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
portable-ownership:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: flutter_local_notifications_windows
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build production deallocators with ASan and UBSan
run: >-
g++ -std=c++17 -O1 -g -Wall -Wextra -Werror
-fsanitize=address,undefined -fno-omit-frame-pointer -fno-pie -no-pie
src/ffi_memory.cpp test/native/ffi_memory_test.cpp -o ffi_memory_test
- name: Exercise the actual C ABI deallocators
env:
ASAN_OPTIONS: alloc_dealloc_mismatch=1:detect_leaks=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
run: ./ffi_memory_test
windows-ownership:
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and run production deallocators with MSVC ASan
shell: pwsh
working-directory: flutter_local_notifications_windows
env:
ASAN_OPTIONS: alloc_dealloc_mismatch=1
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $vs) { throw 'Visual C++ tools not found' }
$vcvars = Join-Path $vs 'VC\Auxiliary\Build\vcvars64.bat'
$command = "call `"$vcvars`" && cl /nologo /std:c++17 /EHsc /Zi /W4 /WX /fsanitize=address src\ffi_memory.cpp test\native\ffi_memory_test.cpp /Fe:ffi_memory_test.exe && ffi_memory_test.exe"
& cmd.exe /d /c $command
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }