-
Notifications
You must be signed in to change notification settings - Fork 225
69 lines (60 loc) · 1.81 KB
/
build-and-test.yml
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 Tests
on:
- push
- pull_request
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
compiler:
- gcc
- clang
dqlite-next:
- yes
- no
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
sudo apt update
sudo apt install -y lcov libsqlite3-dev liblz4-dev libuv1-dev
# TODO: remove once the mysterious hang is fixed
sudo apt install -y gdb
- name: Build dqlite
env:
CC: ${{ matrix.compiler }}
run: |
autoreconf -i
./configure --enable-debug --enable-code-coverage --enable-sanitize \
--enable-build-raft --enable-dqlite-next=${{ matrix.dqlite-next }}
make -j$(nproc) check-norun
- name: Test
env:
CC: ${{ matrix.compiler }}
LIBDQLITE_TRACE: 1
run: |
# TODO: return to just `make check` once the mysterious hang is fixed
tests="$(make print-test-programs | tr ' ' '\n' | grep -v '^unit-test$')"
make check TESTS="$tests"
# Grab backtraces when the unit-test binary hangs (this is a heisenbug
# that we've only been able to trigger in GHA jobs)
./unit-test --no-fork &
pid=$!
bash -c "sleep 10m; sudo gdb -p $pid -batch -ex 'thread apply all bt' -ex quit; false" &
wait -n
- name: Coverage
env:
CC: ${{ matrix.compiler }}
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.compiler == 'gcc' }}
run: |
make code-coverage-capture
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true