Skip to content

Commit fcd48e0

Browse files
committed
feat: add GitHub Actions CI pipeline
Pipeline includes: - Build with clang - Static analysis with clang-tidy - Unit tests with AddressSanitizer (ASan) - Portability fixes for clang-tidy paths in CMakeLists.txt
1 parent 6bfbdd5 commit fcd48e0

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: cloudSQL CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y cmake clang clang-tidy llvm
20+
21+
- name: Configure CMake
22+
run: |
23+
mkdir build
24+
cd build
25+
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DBUILD_TESTS=ON -DBUILD_COVERAGE=OFF
26+
27+
- name: Build with Clang-Tidy
28+
run: |
29+
cd build
30+
make -j$(nproc) sqlEngineCore
31+
make -j$(nproc)
32+
33+
- name: Run Tests
34+
run: |
35+
cd build
36+
./sqlEngine_tests
37+
./lock_manager_tests
38+
./server_tests
39+
./transaction_manager_tests
40+
./statement_tests
41+
./recovery_tests
42+
43+
- name: Check memory safety (ASan)
44+
run: |
45+
echo "ASan is enabled via CMAKE_CXX_FLAGS in CMakeLists.txt and verified during 'Run Tests' step."

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif()
2525
# Clang-Tidy integration
2626
find_program(CLANG_TIDY_BIN
2727
NAMES clang-tidy
28-
PATHS /opt/homebrew/opt/llvm/bin /usr/local/opt/llvm/bin
28+
PATHS /opt/homebrew/opt/llvm/bin /usr/local/opt/llvm/bin /usr/bin /usr/local/bin
2929
)
3030

3131
if(CLANG_TIDY_BIN)

0 commit comments

Comments
 (0)