blob: a15c797a64ee44f2b30664d91af9006243365003 [file] [log] [blame]
Michal Vasko5f861fe2021-05-26 10:55:04 +02001name: libnetconf2 CI
2on:
3 push:
4 branches:
Michal Vasko7678c5d2021-05-27 10:32:13 +02005 - master
6 - devel
Michal Vasko5f861fe2021-05-26 10:55:04 +02007 pull_request:
8 branches:
Michal Vasko7678c5d2021-05-27 10:32:13 +02009 - master
10 - devel
Michal Vasko5f861fe2021-05-26 10:55:04 +020011
12env:
13 DEFAULT_OPTIONS: -DENABLE_BUILD_TESTS=ON -DENABLE_DNSSEC=ON
Michal Vasko29721a82021-05-26 12:05:08 +020014 DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev
Michal Vasko5f861fe2021-05-26 10:55:04 +020015
16jobs:
17 build:
18 name: ${{ matrix.config.name }}
19 runs-on: ${{ matrix.config.os }} # mac-OS does not implement robust mutexes so it is not supported
20 strategy:
21 fail-fast: false
22 matrix:
23 config:
24 - {
25 name: "Release, Ubuntu 18.04, gcc",
26 os: "ubuntu-18.04",
27 build-type: "Release",
28 cc: "gcc",
29 options: "",
30 packager: "sudo apt-get",
31 packages: ""
32 }
33 - {
34 name: "Release, Ubuntu 18.04, clang",
35 os: "ubuntu-18.04",
36 build-type: "Release",
37 cc: "clang",
38 options: "",
39 packager: "sudo apt-get",
40 packages: ""
41 }
42 - {
43 name: "Debug, Ubuntu 18.04, gcc",
44 os: "ubuntu-18.04",
45 build-type: "Debug",
46 cc: "gcc",
47 options: "",
48 packager: "sudo apt-get",
49 packages: "valgrind"
50 }
51 - {
52 name: "Debug, Ubuntu 18.04, clang",
53 os: "ubuntu-18.04",
54 build-type: "Debug",
55 cc: "clang",
56 options: "",
57 packager: "sudo apt-get",
58 packages: "valgrind"
59 }
60 - {
61 name: "SSH Only",
62 os: "ubuntu-18.04",
63 build-type: "Debug",
64 cc: "gcc",
65 options: "DENABLE_TLS=OFF -DENABLE_SSH=ON",
66 packager: "sudo apt-get",
67 packages: "valgrind"
68 }
69 - {
70 name: "TLS Only",
71 os: "ubuntu-18.04",
72 build-type: "Debug",
73 cc: "gcc",
74 options: "DENABLE_TLS=ON -DENABLE_SSH=OFF",
75 packager: "sudo apt-get",
76 packages: "valgrind"
77 }
78 - {
79 name: "No SSH nor TLS",
80 os: "ubuntu-18.04",
81 build-type: "Debug",
82 cc: "gcc",
83 options: "DENABLE_TLS=OFF -DENABLE_SSH=OFF",
84 packager: "sudo apt-get",
85 packages: "valgrind"
86 }
87 - {
88 name: "ASAN and UBSAN",
89 os: "ubuntu-18.04",
90 build-type: "Debug",
91 cc: "clang",
92 options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
93 packager: "sudo apt-get",
94 packages: ""
95 }
96
97 steps:
98 - uses: actions/checkout@v2
99
100 - name: Uncrustify
101 shell: bash
102 working-directory: ${{ github.workspace }}
103 run: |
104 git clone --branch uncrustify-0.71.0 https://github.com/uncrustify/uncrustify
105 cd uncrustify
106 mkdir build
107 cd build
108 CC=${{ matrix.config.cc }} cmake ..
109 make
110 sudo make install
111 if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
112
113 - name: Dependencies
114 shell: bash
115 run: |
Michal Vaskocee52632021-05-26 13:10:21 +0200116 sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
Michal Vasko5f861fe2021-05-26 10:55:04 +0200117 ${{ matrix.config.packager }} update
118 ${{ matrix.config.packager }} install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
119
120 GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
121 git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
122 cd libyang
123 mkdir build
124 cd build
125 CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
126 make -j2
127 sudo make install
128
Michal Vasko29721a82021-05-26 12:05:08 +0200129 git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools
130 cd dnssec-tools/dnssec-tools/validator
131 ./configure
132 make -j2
133 sudo make install
134
135
Michal Vasko5f861fe2021-05-26 10:55:04 +0200136 - name: Configure
137 shell: bash
138 working-directory: ${{ github.workspace }}
139 run: |
140 mkdir build
141 cd build
142 CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} $DEFAULT_OPTIONS ${{ matrix.config.options }} ..
143
144 - name: Build
145 shell: bash
146 working-directory: ${{ github.workspace }}/build
147 run: make
148
149 - name: Test
150 shell: bash
151 working-directory: ${{ github.workspace }}/build
152 run: ctest --output-on-failure
153
Michal Vaskoe7402142021-05-26 13:45:43 +0200154 abi:
155 runs-on: ubuntu-latest
156 steps:
157 - uses: actions/checkout@v2
158
159 - name: Dependencies
160 shell: bash
161 run: |
162 sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
163 sudo apt-get update
164 sudo apt-get install $DEFAULT_PACKAGES abi-dumper abi-compliance-checker
165 sudo snap install core universal-ctags
166
167 GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
168 git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
169 cd libyang
170 mkdir build
171 cd build
172 CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILD_TESTS=OFF ..
173 make -j2
174 sudo make install
175
176 git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools
177 cd dnssec-tools/dnssec-tools/validator
178 ./configure
179 make -j2
180 sudo make install
181
182 - name: Configure
183 shell: bash
184 working-directory: ${{ github.workspace }}
185 run: |
186 mkdir build
187 cd build
188 CC=gcc cmake -DCMAKE_BUILD_TYPE=ABICheck ..
189
190 - name: Build
191 shell: bash
192 working-directory: ${{ github.workspace }}/build
193 run: LC_ALL=C.UTF-8 PATH=/snap/bin:$PATH make abi-check
194
Michal Vasko5f861fe2021-05-26 10:55:04 +0200195 coverage:
196 runs-on: ubuntu-latest
197 steps:
198 - uses: actions/checkout@v2
199
200 - name: Dependencies
201 shell: bash
202 run: |
Michal Vaskocee52632021-05-26 13:10:21 +0200203 sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y
204 sudo apt-get update
Michal Vasko5f861fe2021-05-26 10:55:04 +0200205 sudo apt-get install $DEFAULT_PACKAGES lcov
206
207 GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
208 git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
209 cd libyang
210 mkdir build
211 cd build
Michal Vaskoe7402142021-05-26 13:45:43 +0200212 CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILD_TESTS=OFF ..
Michal Vasko5f861fe2021-05-26 10:55:04 +0200213 make -j2
214 sudo make install
215
216 - name: Configure
217 shell: bash
218 working-directory: ${{ github.workspace }}
219 run: |
220 mkdir build
221 cd build
222 CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
223
224 - name: Build
225 shell: bash
226 working-directory: ${{ github.workspace }}/build
227 run: make
228
229 - name: Test
230 shell: bash
231 working-directory: ${{ github.workspace }}/build
232 run: ctest --output-on-failure
233
234 - name: Upload to Codecov.io
235 shell: bash
236 working-directory: ${{ github.workspace }}/build
237 run: bash <(curl -s https://codecov.io/bash)