-
Notifications
You must be signed in to change notification settings - Fork 40
96 lines (79 loc) · 2.92 KB
/
Copy pathci.yml
File metadata and controls
96 lines (79 loc) · 2.92 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release, Debug]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Eigen3 (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libeigen3-dev
- name: Install Eigen3 (macOS)
if: runner.os == 'macOS'
run: |
brew install eigen
echo "CMAKE_PREFIX_PATH_EXTRA=$(brew --prefix eigen)" >> "$GITHUB_ENV"
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build build -j 4
- name: Test
run: ctest --test-dir build --output-on-failure
- name: C ABI runtime source check
run: python3 scripts/check_c_abi_runtime.py
- name: Install PineForge
run: cmake --install build --prefix "$GITHUB_WORKSPACE/pf_install"
- name: find_package smoke build
shell: bash
env:
WORKSPACE: ${{ github.workspace }}
BUILD_TYPE: ${{ matrix.build_type }}
run: |
set -euo pipefail
EXTRA="${CMAKE_PREFIX_PATH_EXTRA:-}"
PREFIX="${WORKSPACE}/pf_install"
# Pass prefix list to CMake with ';' — ':' is for env vars on Unix only.
CMAKE_PFX="${PREFIX}"
if [[ -n "$EXTRA" ]]; then
CMAKE_PFX="${PREFIX};${EXTRA}"
fi
cmake -S cmake/smoke_consumer -B smoke_build \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_PREFIX_PATH="${CMAKE_PFX}"
cmake --build smoke_build -j 4
expected="$(tr -d '[:space:]' < VERSION)"
./smoke_build/smoke_version | grep -qxF "${expected}"
# Dedicated AddressSanitizer + UndefinedBehaviorSanitizer lane. Without this,
# the determinism / NaN-propagation / handle-reuse / C-ABI-lifecycle probes
# would run un-instrumented and could not actually trip the leak / double-free
# / UB they target. The library is built with the sanitizers PUBLIC so the
# instrumentation propagates into every test binary (CMakeLists.txt option
# PINEFORGE_ENABLE_SANITIZERS).
sanitizers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Eigen3
run: |
sudo apt-get update
sudo apt-get install -y libeigen3-dev
- name: Configure (ASan + UBSan)
run: cmake -B build-asan -DCMAKE_BUILD_TYPE=Debug -DPINEFORGE_ENABLE_SANITIZERS=ON
- name: Build
run: cmake --build build-asan -j 4
- name: Test under sanitizers
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1:abort_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
run: ctest --test-dir build-asan --output-on-failure