forked from opensvc/multipath-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (109 loc) · 3.54 KB
/
build-and-unittest.yaml
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
name: basic-build-and-ci
on:
push:
branches:
- master
- queue
- tip
- 'stable-*'
pull_request:
branches:
- master
- queue
- 'stable-*'
jobs:
jammy:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
rl: ['', 'libreadline', 'libedit']
cc: [ gcc, clang ]
steps:
- uses: actions/checkout@v2
- name: update
run: sudo apt-get update
- name: dependencies
run: >
sudo apt-get install --yes gcc
make pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
libmount-dev linux-modules-extra-$(uname -r)
- name: mpath
run: sudo modprobe dm_multipath
- name: zram
run: sudo modprobe zram num_devices=0
- name: zram-device
run: echo ZRAM=$(sudo cat /sys/class/zram-control/hot_add) >> $GITHUB_ENV
- name: set-zram-size
run: echo 1G | sudo tee /sys/block/zram$ZRAM/disksize
- name: set CC
run: echo CC=${{ matrix.cc }} >> $GITHUB_ENV
- name: set optflags
# valgrind doesn't support the dwarf-5 format of clang 14
run: echo OPT='-O2 -gdwarf-4 -fstack-protector-strong' >> $GITHUB_ENV
if: ${{ matrix.cc == 'clang' }}
- name: build
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
READLINE=${{ matrix.rl }} OPTFLAGS="$OPT"
- name: test
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
OPTFLAGS="$OPT" test
- name: valgrind-test
id: valgrind
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
OPTFLAGS="$OPT" valgrind-test
continue-on-error: true
- name: valgrind-results
run: cat tests/*.vgr
- name: fail if valgrind failed
run: /bin/false
if: steps.valgrind.outcome != 'success'
- name: clean-nonroot-artifacts
run: rm -f tests/dmevents.out tests/directio.out
- name: root-test
run: sudo make DIO_TEST_DEV=/dev/zram$ZRAM test
focal:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
rl: ['', 'libreadline', 'libedit']
cc: [ gcc, clang ]
steps:
- uses: actions/checkout@v2
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536
- name: update
run: sudo apt-get update
- name: dependencies
run: >
sudo apt-get install --yes gcc-10
make pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
- name: set CC
run: echo CC=${{ matrix.cc }} >> $GITHUB_ENV
- name: build
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) READLINE=${{ matrix.rl }}
- name: test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) test
- name: valgrind-test
id: valgrind
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) valgrind-test
continue-on-error: true
- name: valgrind-results
run: cat tests/*.vgr
- name: fail if valgrind failed
run: /bin/false
if: steps.valgrind.outcome != 'success'
- name: clean-nonroot-artifacts
run: rm -f tests/dmevents.out tests/directio.out
- name: root-test
run: sudo make DIO_TEST_DEV=/dev/ram0 test