forked from canonical/dqlite
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.49 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
name: CI Tests
on:
- push
- pull_request
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
compiler:
- gcc
- clang
tracing:
- LIBDQLITE_TRACE=1
- NOLIBDQLITE_TRACE=1
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
sudo apt update
sudo apt install -y lcov libsqlite3-dev liblz4-dev libuv1-dev
- name: Build raft
env:
CC: ${{ matrix.compiler }}
run: |
git clone https://github.com/canonical/raft.git --depth 1
cd raft
autoreconf -i
./configure --enable-debug --enable-sanitize
make -j4
sudo make install
sudo ldconfig
cd ..
- name: Build dqlite
env:
CC: ${{ matrix.compiler }}
run: |
autoreconf -i
./configure --enable-debug --enable-code-coverage --enable-sanitize
make CFLAGS=-O0 -j2
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
export ${{ matrix.tracing }}
make CFLAGS=-O0 -j2 check || (cat ./test-suite.log && false)
- name: Coverage
env:
CC: ${{ matrix.compiler }}
run: if [ "${CC}" = "gcc" ]; then make code-coverage-capture; fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true