Repository navigation
113 lines (103 loc) · 4.05 KB
/
Copy pathci.yml
File metadata and controls
113 lines (103 loc) · 4.05 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
105
106
107
108
109
110
111
112
113
# The port's CI, after the Rust crate's ci.yml, sanitizer.yml, shuttle.yml and
# fuzz.yml (PORTING.md, P1): format, Clang and GCC builds with tests, the
# tests on AArch64 Linux and on macOS, the tests under AddressSanitizer +
# UBSan and under ThreadSanitizer (the Shuttle tests' stand-in), each fuzz
# target for a minute, and the bench's self-check.
# Linux jobs build with Ubuntu 24.04's default Clang (18), GCC 13 and CMake
# 3.28; clang-format is pinned in scripts/check.sh.
name: test
# Every pushed branch runs, so that work in progress is checked before it
# reaches main; pull requests run too.
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
check:
name: format + Clang + GCC + tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y clang libclang-rt-dev ninja-build ccache
- uses: astral-sh/setup-uv@v6
- name: Format, build and test
run: scripts/check.sh
- name: Install, and build a project against the install
run: scripts/check-install.sh
# AArch64: the in-node counts as NEON vectors (the compiler's), the hash
# tags' scalar loop and the latch's `isb` spin hint (PORTING.md, P33).
arm:
name: AArch64 Linux, Clang + tests
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y clang libclang-rt-dev ninja-build ccache
- run: cmake --preset debug
- run: cmake --build --preset debug
- run: ctest --preset debug
# macOS on Apple silicon: no transparent huge pages, no `MADV_HUGEPAGE`
# (PORTING.md, P33). Homebrew's LLVM, whose libc++ has `std::atomic_ref`
# (libc++ 19 and later), which the shared map's latches use; Apple's Clang
# ships an older libc++ on some Xcode versions.
macos:
name: macOS (Apple silicon), Homebrew LLVM + tests
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install tools
run: brew install ninja ccache llvm
- run: cmake --preset debug -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++"
- run: cmake --build --preset debug
- run: ctest --preset debug
sanitizers:
name: ${{ matrix.preset }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
preset: [asan, tsan]
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y clang libclang-rt-dev ninja-build ccache
# ThreadSanitizer needs the address space layout it was built for.
- name: Fix the address space layout for TSan
if: matrix.preset == 'tsan'
run: sudo sysctl vm.mmap_rnd_bits=28
- run: cmake --preset ${{ matrix.preset }}
- run: cmake --build --preset ${{ matrix.preset }}
- run: ctest --preset ${{ matrix.preset }}
fuzz:
name: fuzz (a minute a target)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y clang libclang-rt-dev ninja-build ccache
- run: cmake --preset fuzz
- run: cmake --build --preset fuzz
- name: Run every target
run: |
for target in build/fuzz/bbtree/fuzz/fuzz_*; do
mkdir -p "corpus/$(basename "$target")"
"$target" "corpus/$(basename "$target")" -max_total_time=60
done
bench:
name: bench builds and checks its inputs
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y clang libclang-rt-dev ninja-build ccache
- run: cmake --preset bench
- run: cmake --build --preset bench
- run: build/bench/bbtree/bench/bbtree-bench self-check
- run: build/bench/bbtree/bench/bbtree-bench ci --quick