-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 1.93 KB
/
Copy pathci-main.yml
File metadata and controls
69 lines (61 loc) · 1.93 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
name: CI (Main)
on:
push:
branches: [ "master" ]
paths-ignore:
- "docs/**"
- "**.md"
pull_request:
branches: [ "master" ]
paths-ignore:
- "docs/**"
- "**.md"
jobs:
build-and-test:
runs-on: ubuntu-26.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
compiler:
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
sanitizer: [ tsan, asan ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive # condy lives in third_party/condy
- name: Load ublk Driver
run: |
sudo modprobe ublk_drv 2>/dev/null || true
if [ ! -e /dev/ublk-control ]; then
echo "::error:: /dev/ublk-control is not available on this runner"
exit 1
fi
- name: Configure CMake
run: |
COMPILER=$(${{matrix.compiler.cc}} --version | head -n 1)
echo "Using compiler: $COMPILER"
SANITIZER_FLAG=""
if [ "${{ matrix.sanitizer }}" = "tsan" ]; then
SANITIZER_FLAG="-DUBLKCPP_TESTS_TSAN=ON"
elif [ "${{ matrix.sanitizer }}" = "asan" ]; then
SANITIZER_FLAG="-DUBLKCPP_TESTS_ASAN=ON"
fi
cmake -B ${{github.workspace}}/build \
-G Ninja \
-DUBLKCPP_BUILD_TESTS=ON \
-DUBLKCPP_BUILD_UBLKCTL=ON \
-DUBLKCPP_BUILD_EXAMPLES=ON \
-DUBLKCPP_EXECUTION_BACKEND=stdexec \
$SANITIZER_FLAG \
-DCMAKE_C_COMPILER=${{matrix.compiler.cc}} \
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
run: cmake --build ${{github.workspace}}/build -j$(nproc)
- name: Run Tests
timeout-minutes: 15
working-directory: ${{github.workspace}}/build
run: sudo ./tests/tests