This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
106 lines (93 loc) · 2.92 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
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
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:
- LIBRAFT_TRACE=1
- NOLIBRAFT_TRACE=1
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq lcov linux-libc-dev liblz4-dev libuv1-dev btrfs-progs xfsprogs zfsutils-linux
- name: Build
env:
CC: ${{ matrix.compiler }}
run: |
git clone --depth 1 https://github.com/edlund/amalgamate.git
export PATH=$PATH:$PWD/amalgamate
autoreconf -i
./configure --enable-example --enable-debug --enable-code-coverage --enable-sanitize
amalgamate.py --config=amalgamation.json --source=$(pwd)
$CC raft.c -c -D_GNU_SOURCE -DHAVE_LINUX_AIO_ABI_H -Wall -Wextra -Wpedantic -fpic
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
export ${{ matrix.tracing }}
./test/lib/fs.sh setup
make check $(./test/lib/fs.sh detect) || (cat ./test-suite.log && false)
./test/lib/fs.sh teardown
- 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@v2
with:
verbose: true
build-and-test-nolz4:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
compiler:
- gcc
- clang
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq lcov linux-libc-dev libuv1-dev btrfs-progs xfsprogs zfsutils-linux
- name: Build
env:
CC: ${{ matrix.compiler }}
run: |
git clone --depth 1 https://github.com/edlund/amalgamate.git
export PATH=$PATH:$PWD/amalgamate
autoreconf -i
./configure --enable-example --enable-debug --enable-code-coverage --enable-sanitize --disable-lz4
amalgamate.py --config=amalgamation.json --source=$(pwd)
$CC raft.c -c -D_GNU_SOURCE -DHAVE_LINUX_AIO_ABI_H -Wall -Wextra -Wpedantic -fpic
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
./test/lib/fs.sh setup
make check CFLAGS=-O0 $(./test/lib/fs.sh detect) || (cat ./test-suite.log && false)
./test/lib/fs.sh teardown
- 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