forked from vlasky/sqlite-vec
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (123 loc) · 4.02 KB
/
memory-tests.yaml
File metadata and controls
144 lines (123 loc) · 4.02 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
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
name: Memory Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# Comprehensive memory testing across platforms
memory-tests:
strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
include:
# Linux: Run all sanitizers + Valgrind
- os: ubuntu-latest
platform: linux
sanitizers: all
# macOS: Run ASan and UBSan (no Valgrind due to compatibility issues)
- os: macos-latest
platform: macos
sanitizers: asan-ubsan
# Windows: Run basic memory tests (no Valgrind/ASan)
- os: windows-latest
platform: windows
sanitizers: none
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Linux dependencies
- name: Install Linux dependencies
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential valgrind clang clang-tidy
# macOS dependencies
- name: Install macOS dependencies
if: matrix.platform == 'macos'
run: |
# Clang is pre-installed on macOS runners
echo "Using system clang"
clang --version
# Windows dependencies
- name: Install Windows dependencies
if: matrix.platform == 'windows'
run: |
choco install llvm -y
refreshenv
# Vendor SQLite sources
- name: Vendor SQLite
run: ./scripts/vendor.sh
shell: bash
# Build and run basic memory test
- name: Build and run memory test binary
run: |
make dist/memory-test
./dist/memory-test
shell: bash
# Linux: Run Valgrind
- name: Run Valgrind memory leak detection
if: matrix.platform == 'linux'
run: make test-valgrind
continue-on-error: false
# Linux & macOS: Run AddressSanitizer
- name: Run AddressSanitizer tests
if: matrix.sanitizers == 'all' || matrix.sanitizers == 'asan-ubsan'
run: make test-asan
env:
CC: clang
# Linux: Run UndefinedBehaviorSanitizer
- name: Run UndefinedBehaviorSanitizer tests
if: matrix.sanitizers == 'all' || matrix.sanitizers == 'asan-ubsan'
run: make test-ubsan
env:
CC: clang
# Linux: Run ThreadSanitizer
- name: Run ThreadSanitizer tests
if: matrix.sanitizers == 'all'
run: make test-tsan
env:
CC: clang
continue-on-error: true # TSan may have false positives with SQLite
# Upload artifacts on any result (success or failure)
- name: Upload memory test artifacts
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: memory-test-logs-${{ matrix.platform }}
path: |
valgrind.log
asan-output.log
ubsan-output.log
tsan-output.log
core.*
dist/memory-test
if-no-files-found: ignore
retention-days: 7
# Static analysis with clang-tidy
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy bear build-essential
- name: Vendor SQLite
run: ./scripts/vendor.sh
- name: Generate compile_commands.json
run: |
bear -- make clean all
- name: Run clang-tidy
run: make lint-clang-tidy
continue-on-error: true
- name: Upload clang-tidy results
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: clang-tidy-results
path: clang-tidy-output.txt
if-no-files-found: ignore
retention-days: 7