aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build_scheduled.yml
blob: 997d08fe7f61fc256f0b6a3a91d15e4e077da72a (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Scheduled builds
on:
  workflow_dispatch:
  schedule:
    #At the end of every day
    - cron: '0 0 * * *'

jobs:
  coverage:
    name: Coverage (ubuntu-latest)
    runs-on: ubuntu-latest
    env:
      CFLAGS: -Werror
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Ubuntu Prerequisites
        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 rrdtool librrd-dev
          sudo apt-get install libpcre3-dev libmaxminddb-dev lcov
          sudo apt-get install wdiff colordiff
      - name: Configure
        run: ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-code-coverage --with-pcre2 --with-maxminddb --enable-tls-sigs
      - name: Build
        run: make all
      - name: Test
        run: |
          make check VERBOSE=1
      - name: Generate Coverage Report
        run: |
          make coverage
      - uses: actions/upload-artifact@v4
        with:
          name: ndpi-coverage-report
          path: coverage_report
          retention-days: 7

  documentation:
    name: Documentation (ubuntu-latest)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Python 3.9
        uses: actions/setup-python@v4
        with:
          python-version: "3.9"
      - name: Install Ubuntu Prerequisites
        run: |
          sudo apt-get update
          sudo apt-get install autoconf automake libtool pkg-config gettext flex bison doxygen
      - name: Configure nDPI library
        run: |
          ./autogen.sh --with-only-libndpi --enable-option-checking=fatal --enable-debug-build
      - name: Generate Documentation
        run: |
          pip install --upgrade pip
          pip install -r doc/requirements.txt
          make doc
          mkdir -vp doc/_build/ndpi-documentation-upload/ndpi-documentation
          mv -v doc/_build/html doc/_build/ndpi-documentation-upload/ndpi-documentation/html
      - uses: actions/upload-artifact@v4
        with:
          name: ndpi-documentation
          path: doc/_build/ndpi-documentation-upload
          retention-days: 7

  performance:
    name: Performance (ubuntu-latest)
    runs-on: ubuntu-latest
    env:
      CFLAGS: -Werror
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Ubuntu Prerequisites
        run: |
          sudo apt-get update
          sudo apt-get install libunwind-dev
          sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libpcap-dev parallel
          sudo apt-get install libgoogle-perftools-dev graphviz
          go install github.com/google/pprof@latest
          sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
          pprof -h
      - name: Configure nDPI library
        run: |
          ./autogen.sh --enable-gprof --enable-option-checking=fatal --with-pcre2 --with-maxminddb --enable-tls-sigs
      - name: Build nDPI library
        run: |
          make -j
      - name: Performance Profiling
        run: |
          NDPI_FORCE_PARALLEL_UTESTS=1 NDPI_SKIP_PARALLEL_BAR=1 ./tests/do.sh
          mkdir ndpi-performance-upload
          for d in $(find ./tests/cfgs/* -type d -maxdepth 0 2>/dev/null) ; do
            PROFILE="$(basename $d)"
            mv -v tests/cfgs/${PROFILE}/result/cpu_profile.png ndpi-performance-upload/${PROFILE}_cpu_profile.png
            mv -v tests/cfgs/${PROFILE}/result/heap_profile.png ndpi-performance-upload/${PROFILE}_heap_profile.png
          done
      - uses: actions/upload-artifact@v4
        with:
          name: ndpi-performance
          path: ndpi-performance-upload
          retention-days: 7

  threadsanitizer:
    name: Thread Sanitizer (ubuntu-latest)
    runs-on: ubuntu-latest
    env:
      CFLAGS: -Wextra -Werror
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Ubuntu Prerequisites
        run: |
          sudo apt-get update
          sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libjson-c-dev libpcap-dev rrdtool librrd-dev parallel
      - name: Configure nDPI
        run: |
          ./autogen.sh --enable-option-checking=fatal --with-thread-sanitizer
      - name: Build nDPI
        run: |
          make -j $(nproc) all
          make -j $(nproc) -C example ndpiSimpleIntegration
          make -j $(nproc) -C rrdtool
      - name: Tests
        run: |
          NDPI_FORCE_PARALLEL_UTESTS=1 NDPI_SKIP_PARALLEL_BAR=1 ./tests/do.sh

  localgcrypt:
    name: Local gcrypt on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    env:
      CFLAGS: -Wextra -Werror -DNDPI_EXTENDED_SANITY_CHECKS
    strategy:
      fail-fast: true
      matrix:
        # macos-14 and 15 are on **ARM64**
        os: ["ubuntu-22.04", "ubuntu-24.04", "macOS-13", "macOS-14", "macOS-15", "ubuntu-22.04-arm", "ubuntu-24.04-arm"]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Ubuntu Prerequisites
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          sudo apt-get update
          sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libjson-c-dev libpcap-dev rrdtool librrd-dev parallel libgcrypt20-dev
      - name: Installing MacOS prerequisites
        if: startsWith(matrix.os, 'macOS')
        run: |
          # Avoid (re)installing pkg-config. See: https://github.com/actions/runner-images/issues/10984
          brew install coreutils wdiff colordiff autoconf automake libtool gettext json-c rrdtool parallel libgcrypt
      - name: Configure nDPI
        run: |
          ./autogen.sh --enable-option-checking=fatal --with-local-libgcrypt
      - name: Build nDPI
        run: |
          make -j $(nproc) all
          make -j $(nproc) -C example ndpiSimpleIntegration
          make -j $(nproc) -C rrdtool
      - name: Tests
        run: |
          NDPI_FORCE_PARALLEL_UTESTS=1 NDPI_SKIP_PARALLEL_BAR=1 ./tests/do.sh
          ./tests/do-unit.sh
          ./tests/do-dga.sh

  localgcrypt-windows:
    name: Local gcrypt on ${{ matrix.os }} (msys2)
    runs-on: ${{ matrix.os }}
    env:
      CFLAGS: -Wextra -Werror -DNDPI_EXTENDED_SANITY_CHECKS
    strategy:
      fail-fast: true
      matrix:
        os: ["windows-latest"]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Install Windows msys2 prerequisites
        uses: msys2/setup-msys2@v2
        with:
          msystem: MINGW64
          update: true
          install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool make mingw-w64-x86_64-json-c mingw-w64-x86_64-crt-git mingw-w64-x86_64-pcre mingw-w64-x86_64-libpcap mingw-w64-x86_64-libgcrypt parallel
      - name: Configure nDPI on Windows msys2
        run: |
          msys2 -c './autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-tls-sigs --disable-npcap --with-local-libgcrypt'
      - name: Build nDPI on Windows msys2
        run: |
          msys2 -c 'make -j all'
          msys2 -c 'ldd ./example/ndpiReader.exe'
      - name: Tests
        run: |
          msys2 -c 'NDPI_FORCE_PARALLEL_UTESTS=1 NDPI_SKIP_PARALLEL_BAR=1 ./tests/do.sh'
          msys2 -c './tests/do-unit.sh'
          msys2 -c './tests/do-dga.sh'