summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 6d9cab8d8cdaf3843ea6723e6929750d2f4d19ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
    types: [opened, synchronize, reopened]
  release:
    types: [created]
jobs:
  test:
    name: ${{ matrix.os }} ${{ matrix.gcrypt }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        os: ["ubuntu-latest", "ubuntu-18.04"]
        ndpid_gcrypt: ["-DNDPI_WITH_GCRYPT=OFF", "-DNDPI_WITH_GCRYPT=ON"]

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Install Ubuntu Prerequisites
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          sudo apt-get update
          sudo apt-get install autoconf automake cmake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev zlib1g-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.ndpid_gcrypt, '-DNDPI_WITH_GCRYPT=OFF')
        run: |
          sudo apt-get install libgcrypt20-dev
      - name: Configure nDPI
        run: |
          mkdir build && cd build
          env CMAKE_C_FLAGS='-Werror' cmake .. -DBUILD_EXAMPLES=ON -DBUILD_NDPI=ON -DENABLE_SANITIZER=ON -DENABLE_ZLIB=ON ${{ matrix.ndpid_gcrypt }}
      - name: Build nDPI
        run: |
          make -C build all VERBOSE=1
      - name: Test EXEC
        run: |
          ./build/nDPId-test || test $? -eq 1
          ./build/nDPId -h || test $? -eq 1
      - name: Test DIFF
        if: startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.ndpid_gcrypt, '-DNDPI_WITH_GCRYPT=OFF')
        run: |
          ./test/run_tests.sh ./libnDPI ./build/nDPId-test
      - name: Daemon
        run: |
          make -C ./build daemon VERBOSE=1
          make -C ./build daemon VERBOSE=1
      - name: Dist
        run: |
          ./scripts/make-dist.sh