actions FEATURE use github actions instead of travis CI
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..0c7ecf7
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,184 @@
+name: libnetconf2 CI
+on:
+ push:
+ branches:
+ - libyang2
+ pull_request:
+ branches:
+ - libyang2
+
+env:
+ DEFAULT_OPTIONS: -DENABLE_BUILD_TESTS=ON -DENABLE_DNSSEC=ON
+ DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev libval-dev
+
+jobs:
+ build:
+ name: ${{ matrix.config.name }}
+ runs-on: ${{ matrix.config.os }} # mac-OS does not implement robust mutexes so it is not supported
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {
+ name: "Release, Ubuntu 18.04, gcc",
+ os: "ubuntu-18.04",
+ build-type: "Release",
+ cc: "gcc",
+ options: "",
+ packager: "sudo apt-get",
+ packages: ""
+ }
+ - {
+ name: "Release, Ubuntu 18.04, clang",
+ os: "ubuntu-18.04",
+ build-type: "Release",
+ cc: "clang",
+ options: "",
+ packager: "sudo apt-get",
+ packages: ""
+ }
+ - {
+ name: "Debug, Ubuntu 18.04, gcc",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "gcc",
+ options: "",
+ packager: "sudo apt-get",
+ packages: "valgrind"
+ }
+ - {
+ name: "Debug, Ubuntu 18.04, clang",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "clang",
+ options: "",
+ packager: "sudo apt-get",
+ packages: "valgrind"
+ }
+ - {
+ name: "SSH Only",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "gcc",
+ options: "DENABLE_TLS=OFF -DENABLE_SSH=ON",
+ packager: "sudo apt-get",
+ packages: "valgrind"
+ }
+ - {
+ name: "TLS Only",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "gcc",
+ options: "DENABLE_TLS=ON -DENABLE_SSH=OFF",
+ packager: "sudo apt-get",
+ packages: "valgrind"
+ }
+ - {
+ name: "No SSH nor TLS",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "gcc",
+ options: "DENABLE_TLS=OFF -DENABLE_SSH=OFF",
+ packager: "sudo apt-get",
+ packages: "valgrind"
+ }
+ - {
+ name: "ASAN and UBSAN",
+ os: "ubuntu-18.04",
+ build-type: "Debug",
+ cc: "clang",
+ options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
+ packager: "sudo apt-get",
+ packages: ""
+ }
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Uncrustify
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ run: |
+ git clone --branch uncrustify-0.71.0 https://github.com/uncrustify/uncrustify
+ cd uncrustify
+ mkdir build
+ cd build
+ CC=${{ matrix.config.cc }} cmake ..
+ make
+ sudo make install
+ if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
+
+ - name: Dependencies
+ shell: bash
+ run: |
+ ${{ matrix.config.packager }} update
+ ${{ matrix.config.packager }} install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
+
+ GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
+ git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
+ cd libyang
+ mkdir build
+ cd build
+ CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
+ make -j2
+ sudo make install
+
+ - name: Configure
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ run: |
+ mkdir build
+ cd build
+ CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} $DEFAULT_OPTIONS ${{ matrix.config.options }} ..
+
+ - name: Build
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: make
+
+ - name: Test
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: ctest --output-on-failure
+
+ coverage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Dependencies
+ shell: bash
+ run: |
+ sudo apt-get install $DEFAULT_PACKAGES lcov
+
+ GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
+ git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
+ cd libyang
+ mkdir build
+ cd build
+ CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_BUILD_TESTS=OFF ..
+ make -j2
+ sudo make install
+
+ - name: Configure
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ run: |
+ mkdir build
+ cd build
+ CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
+
+ - name: Build
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: make
+
+ - name: Test
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: ctest --output-on-failure
+
+ - name: Upload to Codecov.io
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: bash <(curl -s https://codecov.io/bash)
diff --git a/.travis-deps-linux.sh b/.travis-deps-linux.sh
deleted file mode 100644
index b5a26bb..0000000
--- a/.travis-deps-linux.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-set -e
-
-sudo apt-get update -qq
-sudo apt-get install -y zlib1g-dev
-sudo apt-get install -y libssl-dev
-sudo apt-get install -y libval-dev
-sudo apt-get install -y valgrind
-sudo apt-get install -y osc
-
-echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
-
-# libssh
-wget https://www.libssh.org/files/0.8/libssh-0.8.5.tar.xz
-tar -xJf libssh-0.8.5.tar.xz
-mkdir libssh-0.8.5/build && cd libssh-0.8.5/build
-cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
-cd ../..
-
-# CMocka
-wget https://cmocka.org/files/1.1/cmocka-1.1.1.tar.xz
-tar -xJf cmocka-1.1.1.tar.xz
-mkdir cmocka-1.1.1/build && cd cmocka-1.1.1/build
-cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
-cd ../..
-
-if [[ "$TRAVIS_BRANCH" = "master" ]]; then LY_BRANCH="master"; else LY_BRANCH="devel"; fi
-git clone -b $LY_BRANCH https://github.com/CESNET/libyang.git
-mkdir libyang/build && cd libyang/build
-cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
-cd ../..
diff --git a/.travis-deps-osx.sh b/.travis-deps-osx.sh
deleted file mode 100644
index e275ec8..0000000
--- a/.travis-deps-osx.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-set -e
-
-#install dependencies using homebrew
-brew update
-brew upgrade openssl
-
-# libssh
-wget https://www.libssh.org/files/0.8/libssh-0.8.5.tar.xz
-tar -xJf libssh-0.8.5.tar.xz
-mkdir libssh-0.8.5/build && cd libssh-0.8.5/build
-cmake -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include .. && make -j2 && sudo make install
-cd ../..
-
-# CMocka
-git clone git://git.cryptomilk.org/projects/cmocka.git
-mkdir cmocka/build && cd cmocka/build
-cmake .. && make -j2 && sudo make install
-cd ../..
-
-if [[ "$TRAVIS_BRANCH" = "master" ]]; then LY_BRANCH="master"; else LY_BRANCH="devel"; fi
-git clone -b $LY_BRANCH https://github.com/CESNET/libyang.git
-mkdir libyang/build && cd libyang/build
-cmake .. && make -j2 && sudo make install
-cd ../..
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 46d1ed9..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-language: c
-
-matrix:
- include:
- - os: linux
- dist: trusty
- sudo: required
- compiler: clang
- env: SANITIZE="OFF"
- - os: linux
- dist: trusty
- sudo: required
- compiler: clang
- env: SANITIZE="ON"
- - os: linux
- dist: trusty
- sudo: required
- compiler: gcc
- env: SANITIZE="OFF"
- - os: osx
- compiler: gcc
- env: SANITIZE="OFF"
- allow_failures:
- - os: osx
-
-branches:
- only:
- - master
- - devel
-
-before_install:
- - eval "${MATRIX_EVAL}"
- - if [ "$TRAVIS_OS_NAME" = "linux" ]; then bash .travis-deps-linux.sh; fi
- - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi
- - if [ "$TRAVIS_OS_NAME" = "osx" ]; then bash .travis-deps-osx.sh; fi
-
-script:
- - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export OPENSSLFLAGS="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"; fi
- - if [ "$SANITIZE" = "ON" ]; then export SANITIZEFLAGS='-DCMAKE_C_FLAGS="-fsanitize=address,undefined" -DENABLE_VALGRIND_TESTS=OFF'; fi
- - cd $TRAVIS_BUILD_DIR && mkdir build_none && cd build_none ; cmake -DENABLE_TLS=OFF -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF $SANITIZEFLAGS .. && make -j2 && ctest --output-on-failure
- - cd $TRAVIS_BUILD_DIR && mkdir build_tls && cd build_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=OFF -DENABLE_DNSSEC=OFF $SANITIZEFLAGS .. && make -j2 && ctest --output-on-failure
- - cd $TRAVIS_BUILD_DIR && mkdir build_ssh && cd build_ssh ; cmake $OPENSSLFLAGS -DENABLE_TLS=OFF -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF $SANITIZEFLAGS .. && make -j2 && ctest --output-on-failure
- - cd $TRAVIS_BUILD_DIR && mkdir build_ssh_tls && cd build_ssh_tls ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=OFF $SANITIZEFLAGS .. && make -j2 && ctest --output-on-failure
- - cd $TRAVIS_BUILD_DIR && mkdir build_all && cd build_all ; cmake $OPENSSLFLAGS -DENABLE_TLS=ON -DENABLE_SSH=ON -DENABLE_DNSSEC=ON $SANITIZEFLAGS .. && make -j2 && ctest --output-on-failure
- - cd -
-
-after_success:
- - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then codecov; ./packages/create-package.sh; fi
diff --git a/README.md b/README.md
index 9d4f2bb..b93801d 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# libnetconf2 – The NETCONF protocol library
[![BSD license](https://img.shields.io/badge/License-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
-[![Build Status](https://secure.travis-ci.org/CESNET/libnetconf2.png?branch=master)](http://travis-ci.org/CESNET/libnetconf2)
+[![Build](https://github.com/CESNET/libnetconf2/workflows/libnetconf2%20CI/badge.svg)](https://github.com/CESNET/libnetconf2/actions?query=workflow%3A%22libnetconf2+CI%22)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/7642/badge.svg)](https://scan.coverity.com/projects/7642)
**libnetconf2** is a NETCONF library in C intended for building NETCONF clients