@@ -2,36 +2,167 @@ name: Build
2
2
on :
3
3
push :
4
4
branches :
5
- - master
5
+ - dev
6
6
pull_request :
7
+ branches :
8
+ - dev
7
9
types : [opened, synchronize, reopened]
10
+ release :
11
+ types : [created]
8
12
jobs :
9
- sonarcloud :
10
- name : SonarCloud
11
- runs-on : ubuntu-latest
13
+ test :
14
+ name : ${{ matrix.os }} ${{ matrix.gcrypt }} ${{ matrix.compiler }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} ${{ matrix.msan }}
15
+ runs-on : ${{ matrix.os }}
16
+ strategy :
17
+ fail-fast : true
18
+ matrix :
19
+ os : ["ubuntu-latest", "ubuntu-18.04", "macOS-latest", "macos-11"]
20
+ gcrypt : ["--disable-gcrypt", ""]
21
+ compiler : ["default-cc"]
22
+ pcre : [""]
23
+ maxminddb : [""]
24
+ msan : [""]
25
+ include :
26
+ - compiler : " gcc-7"
27
+ os : ubuntu-latest
28
+ gcrypt : " "
29
+ pcre : " --with-pcre"
30
+ maxminddb : " --with-maxminddb"
31
+ msan : " --with-sanitizer"
32
+ - compiler : " gcc-10"
33
+ os : ubuntu-latest
34
+ gcrypt : " "
35
+ pcre : " --with-pcre"
36
+ maxminddb : " --with-maxminddb"
37
+ msan : " --with-sanitizer"
38
+ - compiler : " clang-7"
39
+ os : ubuntu-latest
40
+ gcrypt : " "
41
+ pcre : " --with-pcre"
42
+ maxminddb : " --with-maxminddb"
43
+ msan : " --with-sanitizer"
44
+ - compiler : " clang-12"
45
+ os : ubuntu-latest
46
+ gcrypt : " "
47
+ pcre : " --with-pcre"
48
+ maxminddb : " --with-maxminddb"
49
+ msan : " --with-sanitizer"
50
+ - compiler : " default-cc"
51
+ os : ubuntu-latest
52
+ gcrypt : " "
53
+ pcre : " --with-pcre"
54
+ maxminddb : " --with-maxminddb"
55
+ msan : " --with-sanitizer"
56
+ - compiler : " default-cc"
57
+ os : ubuntu-18.04
58
+ gcrypt : " "
59
+ pcre : " --with-pcre"
60
+ maxminddb : " --with-maxminddb"
61
+ msan : " --with-sanitizer"
62
+ - compiler : " default-cc"
63
+ os : macOS-latest
64
+ gcrypt : " "
65
+ pcre : " --with-pcre"
66
+ maxminddb : " --with-maxminddb"
67
+ msan : " --with-sanitizer"
68
+ - compiler : " default-cc"
69
+ os : macos-11
70
+ gcrypt : " "
71
+ pcre : " --with-pcre"
72
+ maxminddb : " --with-maxminddb"
73
+ msan : " --with-sanitizer"
12
74
steps :
13
75
- uses : actions/checkout@v2
14
76
with :
15
77
fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
16
- - name : Install dependencies
17
- run : sudo apt-get install build-essential libc6-dev libpcap-dev libjson-c-dev libgcrypt20-dev gcc-arm-linux-gnueabihf gcc-mingw-w64
18
- - name : Configure
19
- run : env CFLAGS='-Werror' ./autogen.sh
20
- - name : Build
21
- run : make all
22
- - name : Test DIFF
23
- run : ./tests/do.sh
24
- - name : Test UNIT
25
- run : ./tests/unit/unit
26
- - name : Configure (with debug logs)
27
- run : make distclean && env CFLAGS='-Werror' ./autogen.sh --enable-debug-messages
28
- - name : Build
29
- run : make all
30
- - name : Configure ARM
31
- run : make distclean && env CFLAGS='-Werror' ./autogen.sh --host=arm-linux-gnueabihf --with-only-libndpi
32
- - name : Build ARM
33
- run : make all
34
- - name : Configure Mingw-w64
35
- run : make distclean && ./autogen.sh --host=x86_64-w64-mingw32
36
- - name : Build Mingw-w64
37
- run : make all
78
+ - name : Install Ubuntu Prerequisites
79
+ if : startsWith(matrix.os, 'ubuntu')
80
+ run : |
81
+ sudo apt-get update
82
+ sudo apt-get install autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev
83
+ sudo apt-get install gcc-arm-linux-gnueabihf gcc-mingw-w64 libc6-dev
84
+ - name : Install Ubuntu Prerequisites (libgcrypt)
85
+ if : startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
86
+ run : |
87
+ sudo apt-get install libgcrypt20-dev
88
+ - name : Install Ubuntu Prerequisites (libpcre)
89
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.pcre, '--with-pcre')
90
+ run : |
91
+ sudo apt-get install libpcre3-dev
92
+ - name : Install Ubuntu Prerequisites (maxminddb)
93
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.maxminddb, '--with-maxminddb')
94
+ run : |
95
+ sudo apt-get install libmaxminddb-dev
96
+ - name : Setup Ubuntu specified compiler (gcc)
97
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'gcc')
98
+ run : |
99
+ sudo apt-get install ${{ matrix.compiler }}
100
+ - name : Setup Ubuntu specified compiler (clang)
101
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'clang')
102
+ run : |
103
+ sudo apt-get install ${{ matrix.compiler }}
104
+ - name : Installing MacOS prerequisites
105
+ if : startsWith(matrix.os, 'macOS')
106
+ run : |
107
+ brew install autoconf automake libtool pkg-config gettext json-c
108
+ - name : Install MacOS Prerequisites (libgcrypt)
109
+ if : startsWith(matrix.os, 'macOS') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
110
+ run : |
111
+ brew install libgcrypt
112
+ - name : Install MacOS Prerequisites (libpcre)
113
+ if : startsWith(matrix.os, 'macOS') && startsWith(matrix.pcre, '--with-pcre')
114
+ run : |
115
+ brew install pcre
116
+ - name : Install MacOS Prerequisites (maxminddb)
117
+ if : startsWith(matrix.os, 'macOS') && startsWith(matrix.maxminddb, '--with-maxminddb')
118
+ run : |
119
+ brew install libmaxminddb
120
+ - name : Configure nDPI on Ubuntu
121
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'default-cc')
122
+ run : |
123
+ env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
124
+ - name : Configure nDPI on MacOS
125
+ if : startsWith(matrix.os, 'macOS') && startsWith(matrix.compiler, 'default-cc')
126
+ run : |
127
+ env CC=clang CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
128
+ - name : Configure nDPI with specified GCC version on Ubuntu
129
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'gcc')
130
+ run : |
131
+ env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
132
+ - name : Configure nDPI with specified CLANG on Ubuntu
133
+ if : startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'clang')
134
+ run : |
135
+ env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
136
+ - name : Compile nDPI
137
+ run : |
138
+ make all
139
+ cd example
140
+ make ndpiSimpleIntegration
141
+ cd ../python
142
+ make
143
+ cd ..
144
+ - name : Test nDPI [DIFF]
145
+ run : |
146
+ ./tests/do.sh
147
+ - name : Test nDPI [UNIT]
148
+ run : |
149
+ ./tests/do-unit.sh
150
+ - name : Test nDPI [DGA]
151
+ run : |
152
+ ./tests/do-dga.sh
153
+ - name : Configure nDPI [ARM] (runs only on ubuntu jobs)
154
+ if : startsWith(matrix.os, 'ubuntu')
155
+ run : |
156
+ make distclean && env CFLAGS='-Werror' ./autogen.sh --host=arm-linux-gnueabihf --with-only-libndpi ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
157
+ - name : Build nDPI [ARM] (runs only on ubuntu jobs)
158
+ if : startsWith(matrix.os, 'ubuntu')
159
+ run : |
160
+ make all
161
+ - name : Configure nDPI [Mingw-w64] (runs only on ubuntu jobs)
162
+ if : startsWith(matrix.os, 'ubuntu')
163
+ run : |
164
+ make distclean && ./autogen.sh --host=x86_64-w64-mingw32 ${{ matrix.gcrypt }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
165
+ - name : Build nDPI [Mingw-w64] (runs only on ubuntu jobs)
166
+ if : startsWith(matrix.os, 'ubuntu')
167
+ run : |
168
+ make all
0 commit comments