Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI #1303

Merged
merged 23 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 92 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,102 @@ name: Build
on:
push:
branches:
- master
- dev
pull_request:
branches:
- dev
types: [opened, synchronize, reopened]
release:
types: [created]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
test:
name: ${{ matrix.os }} ${{ matrix.gcrypt }} ${{ format(matrix.compiler, '-cc') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "ubuntu-18.04", "macOS-latest", "macos-11"]
gcrypt: ["--disable-gcrypt", ""]
compiler: ["default-cc"]
# We test oldest (available) versus newest (available) compiler version on Ubuntu Latest
include:
- compiler: "g{0}-7"
os: ubuntu-latest
- compiler: "g{0}-10"
os: ubuntu-latest
- compiler: "clang{0}-7"
os: ubuntu-latest
- compiler: "clang{0}-12"
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install dependencies
run: sudo apt-get install build-essential libc6-dev libpcap-dev libjson-c-dev libgcrypt20-dev gcc-arm-linux-gnueabihf gcc-mingw-w64
- name: Configure
run: env CFLAGS='-Werror' ./autogen.sh
- name: Build
run: make all
- name: Test DIFF
run: ./tests/do.sh
- name: Test UNIT
run: ./tests/unit/unit
- name: Configure (with debug logs)
run: make distclean && env CFLAGS='-Werror' ./autogen.sh --enable-debug-messages
- name: Build
run: make all
- name: Configure ARM
run: make distclean && env CFLAGS='-Werror' ./autogen.sh --host=arm-linux-gnueabihf --with-only-libndpi
- name: Build ARM
run: make all
- name: Configure Mingw-w64
run: make distclean && ./autogen.sh --host=x86_64-w64-mingw32
- name: Build Mingw-w64
run: make all
- name: Install Ubuntu Prerequisites
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev
sudo apt-get install gcc-arm-linux-gnueabihf gcc-mingw-w64 libc6-dev
- name: Install Ubuntu Prerequisites (libgcrypt)
if: startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
run: |
sudo apt-get install libgcrypt20-dev
- name: Setup Ubuntu specified compiler (gcc)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'g')
run: |
sudo apt-get install ${{ format(matrix.compiler, 'cc') }}
sudo apt-get install ${{ format(matrix.compiler, '++') }}
utoni marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup Ubuntu specified compiler (clang)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'c')
run: |
sudo apt-get install ${{ format(matrix.compiler, '') }}
sudo apt-get install ${{ format(matrix.compiler, '++') }}
utoni marked this conversation as resolved.
Show resolved Hide resolved
- name: Installing MacOS prerequisites
if: startsWith(matrix.os, 'macOS')
run: |
brew install autoconf automake libtool pkg-config gettext json-c
- name: Install MacOS Prerequisites (libgcrypt)
if: startsWith(matrix.os, 'macOS') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
run: |
brew install libgcrypt
- name: Configure nDPI
if: startsWith(matrix.compiler, 'default-cc')
run: |
env CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }}
- name: Configure nDPI with specified GCC version on Ubuntu
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'g')
run: |
env CC=${{ format(matrix.compiler, 'cc') }} CXX=${{ format(matrix.compiler, '++') }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }}
- name: Configure nDPI with specified CLANG on Ubuntu
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'c')
run: |
env CC=${{ format(matrix.compiler, '') }} CXX=${{ format(matrix.compiler, '++') }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }}
- name: Build nDPI
run: |
make all
utoni marked this conversation as resolved.
Show resolved Hide resolved
- name: Test nDPI [DIFF]
run: |
./tests/do.sh
- name: Test nDPI [UNIT]
run: |
./tests/do-unit.sh
- name: Test nDPI [DGA]
run: |
./tests/do-dga.sh
- name: Configure nDPI [ARM] (runs only on ubuntu jobs)
if: startsWith(matrix.os, 'ubuntu')
run: |
make distclean && env CFLAGS='-Werror' ./autogen.sh --host=arm-linux-gnueabihf --with-only-libndpi ${{ matrix.gcrypt }}
- name: Build nDPI [ARM] (runs only on ubuntu jobs)
if: startsWith(matrix.os, 'ubuntu')
run: |
make all
- name: Configure nDPI [Mingw-w64] (runs only on ubuntu jobs)
if: startsWith(matrix.os, 'ubuntu')
run: |
make distclean && ./autogen.sh --host=x86_64-w64-mingw32 ${{ matrix.gcrypt }}
- name: Build nDPI [Mingw-w64] (runs only on ubuntu jobs)
if: startsWith(matrix.os, 'ubuntu')
run: |
make all
241 changes: 0 additions & 241 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![ntop][ntopng_logo] ![ntop][ntop_logo]
# nDPI

[![Build Status](https://travis-ci.org/ntop/nDPI.png?branch=dev)](https://travis-ci.org/ntop/nDPI)
[![Build Status](https://img.shields.io/github/workflow/status/ntop/nDPI/Build/dev?logo=github)](https://github.com/ntop/nDPI/actions?query=workflow%3ABuild)
[![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/alerts)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/ndpi.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:ndpi)
Expand Down
2 changes: 1 addition & 1 deletion configure.seed
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ case "$host" in
;;
esac
CFLAGS="${CFLAGS}"
LDFLAGS="${LDFLAGS} -lws2_32 -lucrtbase"
LDFLAGS="${LDFLAGS} -lws2_32"
BUILD_MINGW=1
;;
*)
Expand Down