-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 5.25 KB
/
ci.yml
File metadata and controls
104 lines (87 loc) · 5.25 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
name: CI Build Tests
on:
push:
pull_request:
release:
types: [published]
schedule:
- cron: '30 3 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# ── Linux gcc-11 ──────────────────────────────────────────
- { os: ubuntu-latest, cc: gcc-11, cxx: g++-11, name: gcc-11, config: default, sanitize: none }
- { os: ubuntu-latest, cc: gcc-11, cxx: g++-11, name: gcc-11, config: asan-ubsan, sanitize: address+undefined }
# ── Linux gcc-12 ──────────────────────────────────────────
- { os: ubuntu-latest, cc: gcc-12, cxx: g++-12, name: gcc-12, config: default, sanitize: none }
- { os: ubuntu-latest, cc: gcc-12, cxx: g++-12, name: gcc-12, config: asan-ubsan, sanitize: address+undefined }
- { os: ubuntu-latest, cc: gcc-12, cxx: g++-12, name: gcc-12, config: tsan, sanitize: thread }
# ── Linux clang-14 ────────────────────────────────────────
- { os: ubuntu-latest, cc: clang-14, cxx: clang++-14, name: clang-14, config: default, sanitize: none }
- { os: ubuntu-latest, cc: clang-14, cxx: clang++-14, name: clang-14, config: asan-ubsan, sanitize: address+undefined }
# ── Linux clang-15 ────────────────────────────────────────
- { os: ubuntu-latest, cc: clang-15, cxx: clang++-15, name: clang-15, config: default, sanitize: none }
- { os: ubuntu-latest, cc: clang-15, cxx: clang++-15, name: clang-15, config: asan-ubsan, sanitize: address+undefined }
- { os: ubuntu-latest, cc: clang-15, cxx: clang++-15, name: clang-15, config: tsan, sanitize: thread }
# ── macOS Homebrew clang ──────────────────────────────────
- { os: macos-latest, cc: /opt/homebrew/opt/llvm/bin/clang, cxx: /opt/homebrew/opt/llvm/bin/clang++, name: clang, config: default, sanitize: none }
# ── macOS AppleClang ──────────────────────────────────────
- { os: macos-latest, name: AppleClang, config: default, sanitize: none }
# ── Windows MSVC ──────────────────────────────────────────
# Sanitizers are no-ops on MSVC in our helper — default only.
- { os: windows-latest, name: msvc, config: default, sanitize: none }
# ── Windows MinGW GCC ─────────────────────────────────────
- { os: windows-latest, name: mingw-gcc, config: default, sanitize: none }
name: ${{ matrix.os }} / ${{ matrix.name }} / ${{ matrix.config }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Compiler (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.cc }}
if [[ "${{ matrix.cxx }}" != *"clang"* ]]; then
sudo apt-get install -y ${{ matrix.cxx }}
fi
- name: Install LLVM (macOS clang)
if: matrix.os == 'macos-latest' && matrix.name == 'clang'
run: brew install llvm || brew upgrade llvm
- name: Setup MSVC environment
if: matrix.name == 'msvc'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
- name: Configure
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
EXTRA=""
if [ "${{ matrix.name }}" = "msvc" ]; then
EXTRA="-G Ninja -DCMAKE_BUILD_TYPE=Release"
elif [ "${{ matrix.name }}" = "mingw-gcc" ]; then
EXTRA="-G \"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++"
fi
# Tests + fuzz smoke harnesses run on every matrix cell. The fuzz
# harnesses are registered as CTest cases with a 5k-iter smoke
# budget (see CMakeLists.txt) so they complete in seconds — the
# long fuzz campaign lives in fuzz-nightly.yml.
eval "cmake -S . -B build \
-DSERIALIZATION_BUILD_TESTS=ON \
-DSERIALIZATION_BUILD_FUZZ=ON \
-DSERIALIZATION_SANITIZE=${{ matrix.sanitize }} \
$EXTRA"
- name: Build
run: cmake --build build --config Release -j2
- name: Run all tests (ctest)
shell: bash
working-directory: build
# ctest picks up every registered target (unit tests + every fuzz
# smoke harness) so new tests added to CMakeLists.txt are covered
# automatically without editing this workflow.
run: ctest --output-on-failure -C Release