Skip to content

Commit 86f8ed3

Browse files
committed
Merge branch 'devel'
2 parents 891b73a + 57c9114 commit 86f8ed3

36 files changed

+2052
-1326
lines changed

.github/workflows/ci.yml

Lines changed: 95 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,28 @@ on:
1010
- devel
1111

1212
env:
13-
DEFAULT_OPTIONS: -DENABLE_BUILD_TESTS=ON -DENABLE_DNSSEC=ON
1413
DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev
1514

1615
jobs:
16+
git-branch:
17+
name: Get git branch
18+
runs-on: ubuntu-18.04
19+
outputs:
20+
branch-name: ${{ steps.get-git-branch.outputs.branch-name }}
21+
steps:
22+
- id: get-git-branch
23+
run: |
24+
if ${{ github.event_name == 'push' }}
25+
then export GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
26+
else
27+
export GIT_BRANCH=${{ github.base_ref }}
28+
fi
29+
echo "::set-output name=branch-name::$GIT_BRANCH"
30+
1731
build:
1832
name: ${{ matrix.config.name }}
19-
runs-on: ${{ matrix.config.os }} # mac-OS does not implement robust mutexes so it is not supported
33+
runs-on: ${{ matrix.config.os }}
34+
needs: git-branch
2035
strategy:
2136
fail-fast: false
2237
matrix:
@@ -25,79 +40,125 @@ jobs:
2540
name: "Release, Ubuntu 18.04, gcc",
2641
os: "ubuntu-18.04",
2742
build-type: "Release",
43+
dep-build-type: "Release",
2844
cc: "gcc",
29-
options: "",
30-
packager: "sudo apt-get",
31-
packages: ""
45+
options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON",
46+
packages: "",
47+
snaps: "",
48+
make-prepend: "",
49+
make-target: ""
3250
}
3351
- {
3452
name: "Release, Ubuntu 18.04, clang",
3553
os: "ubuntu-18.04",
3654
build-type: "Release",
55+
dep-build-type: "Release",
3756
cc: "clang",
38-
options: "",
39-
packager: "sudo apt-get",
40-
packages: ""
57+
options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON",
58+
packages: "",
59+
snaps: "",
60+
make-prepend: "",
61+
make-target: ""
4162
}
4263
- {
4364
name: "Debug, Ubuntu 18.04, gcc",
4465
os: "ubuntu-18.04",
4566
build-type: "Debug",
67+
dep-build-type: "Release",
4668
cc: "gcc",
47-
options: "",
48-
packager: "sudo apt-get",
49-
packages: "valgrind"
69+
options: "-DENABLE_DNSSEC=ON",
70+
packages: "valgrind",
71+
snaps: "",
72+
make-prepend: "",
73+
make-target: ""
5074
}
5175
- {
5276
name: "Debug, Ubuntu 18.04, clang",
5377
os: "ubuntu-18.04",
5478
build-type: "Debug",
79+
dep-build-type: "Release",
5580
cc: "clang",
56-
options: "",
57-
packager: "sudo apt-get",
58-
packages: "valgrind"
81+
options: "-DENABLE_DNSSEC=ON",
82+
packages: "valgrind",
83+
snaps: "",
84+
make-prepend: "",
85+
make-target: ""
5986
}
6087
- {
6188
name: "SSH Only",
6289
os: "ubuntu-18.04",
6390
build-type: "Debug",
91+
dep-build-type: "Release",
6492
cc: "gcc",
65-
options: "DENABLE_TLS=OFF -DENABLE_SSH=ON",
66-
packager: "sudo apt-get",
67-
packages: "valgrind"
93+
options: "-DENABLE_TLS=OFF -DENABLE_SSH=ON",
94+
packages: "valgrind",
95+
snaps: "",
96+
make-prepend: "",
97+
make-target: ""
6898
}
6999
- {
70100
name: "TLS Only",
71101
os: "ubuntu-18.04",
72102
build-type: "Debug",
103+
dep-build-type: "Release",
73104
cc: "gcc",
74-
options: "DENABLE_TLS=ON -DENABLE_SSH=OFF",
75-
packager: "sudo apt-get",
76-
packages: "valgrind"
105+
options: "-DENABLE_TLS=ON -DENABLE_SSH=OFF",
106+
packages: "valgrind",
107+
snaps: "",
108+
make-prepend: "",
109+
make-target: ""
77110
}
78111
- {
79112
name: "No SSH nor TLS",
80113
os: "ubuntu-18.04",
81114
build-type: "Debug",
115+
dep-build-type: "Release",
82116
cc: "gcc",
83-
options: "DENABLE_TLS=OFF -DENABLE_SSH=OFF",
84-
packager: "sudo apt-get",
85-
packages: "valgrind"
117+
options: "-DENABLE_TLS=OFF -DENABLE_SSH=OFF",
118+
packages: "valgrind",
119+
snaps: "",
120+
make-prepend: "",
121+
make-target: ""
86122
}
87123
- {
88124
name: "ASAN and UBSAN",
89125
os: "ubuntu-18.04",
90126
build-type: "Debug",
127+
dep-build-type: "Release",
91128
cc: "clang",
92129
options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
93-
packager: "sudo apt-get",
94-
packages: ""
130+
packages: "",
131+
snaps: "",
132+
make-prepend: "",
133+
make-target: ""
134+
}
135+
- {
136+
name: "ABI Check",
137+
os: "ubuntu-latest",
138+
build-type: "ABICheck",
139+
dep-build-type: "Debug",
140+
cc: "gcc",
141+
options: "",
142+
packages: "abi-dumper abi-compliance-checker snap",
143+
snaps: "core universal-ctags",
144+
make-prepend: "",
145+
make-target: "abi-check"
95146
}
96147

97148
steps:
98149
- uses: actions/checkout@v2
99150

100-
- name: Uncrustify
151+
- name: Deps-packages
152+
shell: bash
153+
run: |
154+
sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
155+
sudo apt-get update
156+
sudo apt-get install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
157+
if ${{ matrix.config.snaps != '' }}
158+
then sudo snap refresh; sudo snap install ${{ matrix.config.snaps }}
159+
fi
160+
161+
- name: Deps-uncrustify
101162
shell: bash
102163
working-directory: ${{ github.workspace }}
103164
run: |
@@ -110,79 +171,20 @@ jobs:
110171
sudo make install
111172
if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
112173

113-
- name: Dependencies
174+
- name: Deps-libyang
114175
shell: bash
115176
run: |
116-
sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
117-
${{ matrix.config.packager }} update
118-
${{ matrix.config.packager }} install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
119-
120-
if ${{ github.event_name == 'push' }}
121-
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
122-
else
123-
GIT_BRANCH=${{ github.base_ref }}
124-
fi
125-
126-
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
177+
git clone -b ${{needs.git-branch.outputs.branch-name}} https://github.com/CESNET/libyang.git
127178
cd libyang
128179
mkdir build
129180
cd build
130-
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
131-
make -j2
132-
sudo make install
133-
134-
git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools
135-
cd dnssec-tools/dnssec-tools/validator
136-
./configure
181+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.dep-build-type }} -DENABLE_BUILD_TESTS=OFF ..
137182
make -j2
138183
sudo make install
139184
140-
141-
- name: Configure
142-
shell: bash
143-
working-directory: ${{ github.workspace }}
144-
run: |
145-
mkdir build
146-
cd build
147-
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} $DEFAULT_OPTIONS ${{ matrix.config.options }} ..
148-
149-
- name: Build
150-
shell: bash
151-
working-directory: ${{ github.workspace }}/build
152-
run: make
153-
154-
- name: Test
155-
shell: bash
156-
working-directory: ${{ github.workspace }}/build
157-
run: ctest --output-on-failure
158-
159-
abi:
160-
runs-on: ubuntu-latest
161-
steps:
162-
- uses: actions/checkout@v2
163-
164-
- name: Dependencies
185+
- name: Deps-libval
165186
shell: bash
166187
run: |
167-
sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
168-
sudo apt-get update
169-
sudo apt-get install $DEFAULT_PACKAGES abi-dumper abi-compliance-checker
170-
sudo snap install core universal-ctags
171-
172-
if ${{ github.event_name == 'push' }}
173-
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
174-
else
175-
GIT_BRANCH=${{ github.base_ref }}
176-
fi
177-
178-
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
179-
cd libyang
180-
mkdir build
181-
cd build
182-
CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILD_TESTS=OFF ..
183-
make -j2
184-
sudo make install
185-
186188
git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools
187189
cd dnssec-tools/dnssec-tools/validator
188190
./configure
@@ -195,58 +197,17 @@ jobs:
195197
run: |
196198
mkdir build
197199
cd build
198-
CC=gcc cmake -DCMAKE_BUILD_TYPE=ABICheck ..
200+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
199201
200202
- name: Build
201203
shell: bash
202204
working-directory: ${{ github.workspace }}/build
203-
run: LC_ALL=C.UTF-8 PATH=/snap/bin:$PATH make abi-check
204-
205-
coverage:
206-
runs-on: ubuntu-latest
207-
steps:
208-
- uses: actions/checkout@v2
209-
210-
- name: Dependencies
211-
shell: bash
212-
run: |
213-
sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
214-
sudo apt-get update
215-
sudo apt-get install $DEFAULT_PACKAGES lcov
216-
217-
if ${{ github.event_name == 'push' }}
218-
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
219-
else
220-
GIT_BRANCH=${{ github.base_ref }}
221-
fi
222-
223-
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
224-
cd libyang
225-
mkdir build
226-
cd build
227-
CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILD_TESTS=OFF ..
228-
make -j2
229-
sudo make install
230-
231-
- name: Configure
232-
shell: bash
233-
working-directory: ${{ github.workspace }}
234205
run: |
235-
mkdir build
236-
cd build
237-
CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
238-
239-
- name: Build
240-
shell: bash
241-
working-directory: ${{ github.workspace }}/build
242-
run: make
206+
export LC_ALL=C.UTF-8
207+
export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH
208+
${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }}
243209
244210
- name: Test
245211
shell: bash
246212
working-directory: ${{ github.workspace }}/build
247213
run: ctest --output-on-failure
248-
249-
- name: Upload to Codecov.io
250-
shell: bash
251-
working-directory: ${{ github.workspace }}/build
252-
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)