-
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (36 loc) · 1.03 KB
/
ci.yml
File metadata and controls
42 lines (36 loc) · 1.03 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
name: C++ CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-run:
runs-on: ubuntu-latest
env:
ASAN_OPTIONS: detect_leaks=1 # automatically detect memory leaks
steps:
# 1. Checkout repo
- name: Checkout code
uses: actions/checkout@v4
# 2. Install build tools
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++-14 clang clang-format
# 3. Clang-format check
- name: Clang-format Check
run: |
./clang-check.sh *.cpp *.hpp *.c *.h
# 4. Build and run all examples dynamically
- name: Build and Run
run: |
for san in address thread undefined; do
echo "=== Building all examples with sanitizer $san ==="
make SANITIZE=$san
echo "=== Running all examples with sanitizer $san ==="
make run
done
- name: Clean up build artifacts
run: |
make clean