-
Notifications
You must be signed in to change notification settings - Fork 311
151 lines (129 loc) · 3.94 KB
/
ci.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: libnl3-ci
on:
push:
pull_request:
jobs:
clang-format:
runs-on: ubuntu-latest
container:
image: fedora:38
steps:
- name: Install packages
run: |
sudo dnf install -y \
clang-tools-extra \
git
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup git
run: |
git config --global --add safe.directory "$PWD"
- name: Formatting with clang-format
run: |
clang-format --version
./tools/clang-format.sh -n
ci:
strategy:
matrix:
include:
- cc: gcc
- cc: clang
runs-on: ubuntu-latest
steps:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install \
check \
valgrind \
libtool-bin
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Lint Python
if: ${{ matrix.cc == 'gcc' }}
run: |
python3 -m pip install flake8
flake8 . --count --show-source --statistics
- name: Code formatting with Python black
if: ${{ matrix.cc == 'gcc' }}
run: |
python3 -m pip install black==22.12.0
black --check .
- name: Build
run: |
set -x
export CC="${{ matrix.cc }}"
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -Wall -Wdeclaration-after-statement -Wvla -std=gnu11"
if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
fi
./autogen.sh
./configure
make -j 5
shell: bash
- name: Build Unit Tests
run: make -j 5 check-progs
- name: Run Unit Tests
run: |
set -x
export NLTST_SEED_RAND=
for i in `seq 1 5`; do
tests/check-all
tests/check-direct
make -j check
done
- name: Run Unit Tests w/Valgrind
run: |
set -x
export NLTST_SEED_RAND=
CK_FORK=no libtool --mode=execute valgrind --error-exitcode=66 --leak-check=full -s --show-leak-kinds=all ./tests/check-all
CK_FORK=no libtool --mode=execute valgrind --error-exitcode=66 --leak-check=full -s --show-leak-kinds=all ./tests/check-direct
shell: bash
- name: Install packages for Release
run: |
python3 -m pip install \
asciidoc \
graphviz \
pygments
sudo apt-get -y --no-install-recommends install \
doxygen \
graphviz \
mscgen \
source-highlight
- name: Build Release
run: |
set -x
git clean -fdx
export CC="${{ matrix.cc }}"
NO_GPG_SIGN=1 ./tools/build_release.sh BuildAll
- name: Build out-of-tree and disable-static
run: |
set -x
git clean -fdx
export CC="${{ matrix.cc }}"
export CFLAGS="-Werror -Wall -Wdeclaration-after-statement -Wvla -std=gnu11"
if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
fi
./autogen.sh
mkdir build
cd build
../configure --disable-static
make -j 5
make -j 5 check-progs
export NLTST_SEED_RAND=
make -j 5 check
- name: Link with mold
run: |
sudo apt-get -y --no-install-recommends install \
mold
git clean -fdx
export LDFLAGS="-fuse-ld=mold -Wl,--fatal-warnings"
./autogen.sh
./configure
make -j 5 V=1
- run: echo "🍏 This job's status is ${{ job.status }}."