-
Notifications
You must be signed in to change notification settings - Fork 7
154 lines (128 loc) · 3.81 KB
/
ci.yml
File metadata and controls
154 lines (128 loc) · 3.81 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
145
146
147
148
149
150
151
152
153
154
name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
jobs:
format-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install clang-format 18.1.8
run: pip install clang-format==18.1.8
- name: Check C++ formatting
run: |
clang-format --version
./scripts/format_check.sh
tidy-check:
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-18 clang-tidy-18 libomp-18-dev libopenblas-dev cmake
sudo ln -sf /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy
- name: Configure
run: cmake -B build -DPDX_COMPILE_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: cmake --build build -j$(nproc)
- name: Run clang-tidy
run: |
ln -s build/compile_commands.json compile_commands.json
./scripts/tidy_check.sh
cpp-build-and-test:
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-18 libomp-18-dev libopenblas-dev cmake
- name: Configure
run: cmake -B build -DPDX_COMPILE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build tests
run: cmake --build build -j$(nproc) --target tests
- name: Run tests
run: ctest --test-dir build --output-on-failure
python:
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-18 libomp-18-dev libopenblas-dev cmake
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python bindings
run: pip install .
- name: Verify import
run: python -c "import pdxearch; print('pdxearch imported successfully')"
sanitizers-asan-ubsan:
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-18 libomp-18-dev libopenblas-dev cmake
- name: Configure with ASan + UBSan
run: |
cmake -B build_asan -DPDX_COMPILE_TESTS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
- name: Build tests
run: cmake --build build_asan -j$(nproc) --target tests
- name: Run tests
run: ctest --test-dir build_asan --output-on-failure
ci-pass:
runs-on: ubuntu-latest
if: always()
needs:
- format-check
- tidy-check
- cpp-build-and-test
- python
- sanitizers-asan-ubsan
steps:
- name: Check all jobs passed
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
fi