Skip to content

Commit 5f861fe

Browse files
committed
actions FEATURE use github actions instead of travis CI
1 parent b83a3fa commit 5f861fe

File tree

5 files changed

+185
-105
lines changed

5 files changed

+185
-105
lines changed

.github/workflows/ci.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
name: libnetconf2 CI
2+
on:
3+
push:
4+
branches:
5+
- libyang2
6+
pull_request:
7+
branches:
8+
- libyang2
9+
10+
env:
11+
DEFAULT_OPTIONS: -DENABLE_BUILD_TESTS=ON -DENABLE_DNSSEC=ON
12+
DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev libval-dev
13+
14+
jobs:
15+
build:
16+
name: ${{ matrix.config.name }}
17+
runs-on: ${{ matrix.config.os }} # mac-OS does not implement robust mutexes so it is not supported
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {
23+
name: "Release, Ubuntu 18.04, gcc",
24+
os: "ubuntu-18.04",
25+
build-type: "Release",
26+
cc: "gcc",
27+
options: "",
28+
packager: "sudo apt-get",
29+
packages: ""
30+
}
31+
- {
32+
name: "Release, Ubuntu 18.04, clang",
33+
os: "ubuntu-18.04",
34+
build-type: "Release",
35+
cc: "clang",
36+
options: "",
37+
packager: "sudo apt-get",
38+
packages: ""
39+
}
40+
- {
41+
name: "Debug, Ubuntu 18.04, gcc",
42+
os: "ubuntu-18.04",
43+
build-type: "Debug",
44+
cc: "gcc",
45+
options: "",
46+
packager: "sudo apt-get",
47+
packages: "valgrind"
48+
}
49+
- {
50+
name: "Debug, Ubuntu 18.04, clang",
51+
os: "ubuntu-18.04",
52+
build-type: "Debug",
53+
cc: "clang",
54+
options: "",
55+
packager: "sudo apt-get",
56+
packages: "valgrind"
57+
}
58+
- {
59+
name: "SSH Only",
60+
os: "ubuntu-18.04",
61+
build-type: "Debug",
62+
cc: "gcc",
63+
options: "DENABLE_TLS=OFF -DENABLE_SSH=ON",
64+
packager: "sudo apt-get",
65+
packages: "valgrind"
66+
}
67+
- {
68+
name: "TLS Only",
69+
os: "ubuntu-18.04",
70+
build-type: "Debug",
71+
cc: "gcc",
72+
options: "DENABLE_TLS=ON -DENABLE_SSH=OFF",
73+
packager: "sudo apt-get",
74+
packages: "valgrind"
75+
}
76+
- {
77+
name: "No SSH nor TLS",
78+
os: "ubuntu-18.04",
79+
build-type: "Debug",
80+
cc: "gcc",
81+
options: "DENABLE_TLS=OFF -DENABLE_SSH=OFF",
82+
packager: "sudo apt-get",
83+
packages: "valgrind"
84+
}
85+
- {
86+
name: "ASAN and UBSAN",
87+
os: "ubuntu-18.04",
88+
build-type: "Debug",
89+
cc: "clang",
90+
options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
91+
packager: "sudo apt-get",
92+
packages: ""
93+
}
94+
95+
steps:
96+
- uses: actions/checkout@v2
97+
98+
- name: Uncrustify
99+
shell: bash
100+
working-directory: ${{ github.workspace }}
101+
run: |
102+
git clone --branch uncrustify-0.71.0 https://github.com/uncrustify/uncrustify
103+
cd uncrustify
104+
mkdir build
105+
cd build
106+
CC=${{ matrix.config.cc }} cmake ..
107+
make
108+
sudo make install
109+
if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
110+
111+
- name: Dependencies
112+
shell: bash
113+
run: |
114+
${{ matrix.config.packager }} update
115+
${{ matrix.config.packager }} install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
116+
117+
GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
118+
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
119+
cd libyang
120+
mkdir build
121+
cd build
122+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
123+
make -j2
124+
sudo make install
125+
126+
- name: Configure
127+
shell: bash
128+
working-directory: ${{ github.workspace }}
129+
run: |
130+
mkdir build
131+
cd build
132+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} $DEFAULT_OPTIONS ${{ matrix.config.options }} ..
133+
134+
- name: Build
135+
shell: bash
136+
working-directory: ${{ github.workspace }}/build
137+
run: make
138+
139+
- name: Test
140+
shell: bash
141+
working-directory: ${{ github.workspace }}/build
142+
run: ctest --output-on-failure
143+
144+
coverage:
145+
runs-on: ubuntu-latest
146+
steps:
147+
- uses: actions/checkout@v2
148+
149+
- name: Dependencies
150+
shell: bash
151+
run: |
152+
sudo apt-get install $DEFAULT_PACKAGES lcov
153+
154+
GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
155+
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
156+
cd libyang
157+
mkdir build
158+
cd build
159+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
160+
make -j2
161+
sudo make install
162+
163+
- name: Configure
164+
shell: bash
165+
working-directory: ${{ github.workspace }}
166+
run: |
167+
mkdir build
168+
cd build
169+
CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
170+
171+
- name: Build
172+
shell: bash
173+
working-directory: ${{ github.workspace }}/build
174+
run: make
175+
176+
- name: Test
177+
shell: bash
178+
working-directory: ${{ github.workspace }}/build
179+
run: ctest --output-on-failure
180+
181+
- name: Upload to Codecov.io
182+
shell: bash
183+
working-directory: ${{ github.workspace }}/build
184+
run: bash <(curl -s https://codecov.io/bash)

.travis-deps-linux.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.travis-deps-osx.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# libnetconf2 – The NETCONF protocol library
22

33
[![BSD license](https://img.shields.io/badge/License-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
4-
[![Build Status](https://secure.travis-ci.org/CESNET/libnetconf2.png?branch=master)](http://travis-ci.org/CESNET/libnetconf2)
4+
[![Build](https://github.com/CESNET/libnetconf2/workflows/libnetconf2%20CI/badge.svg)](https://github.com/CESNET/libnetconf2/actions?query=workflow%3A%22libnetconf2+CI%22)
55
[![Coverity Scan Build Status](https://scan.coverity.com/projects/7642/badge.svg)](https://scan.coverity.com/projects/7642)
66

77
**libnetconf2** is a NETCONF library in C intended for building NETCONF clients

0 commit comments

Comments
 (0)