-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
141 lines (134 loc) · 5.63 KB
/
.cirrus.yml
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
env:
BUILD_DIR: "build"
GCOVR_FLAGS: "--gcov-ignore-parse-errors --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml"
task:
name: Test FreeBSD
freebsd_instance:
matrix:
image_family: freebsd-12-3
image_family: freebsd-13-0
install_script:
- pkg install -y bash cmake git gmake gsed libpcap tcpreplay
configure_script:
# Ensure user have access to network devices instead of giving super-user right
- chmod a+rw /dev/bpf*
- cmake -S . -B Dist
build_script:
- cmake --build Dist -j 2
test_pcapplusplus_script:
- ifconfig vtnet0 promisc
- python -m ensurepip
- python -m pip install -r ci/run_tests/requirements.txt
- python ci/run_tests/run_tests.py --interface vtnet0
test_examples_script:
- cd Tests/ExamplesTest
- python -m ensurepip
- python -m pip install -r requirements.txt
- python -m pytest --interface vtnet0 --root-path=../../Dist/examples_bin
task:
name: Test Zstd Linux
container:
image: seladb/ubuntu2004-zstd:latest
configure_script:
- cmake -DLIGHT_PCAPNG_ZSTD=ON -DPCAPPP_BUILD_COVERAGE=ON -S . -B Dist
build_script:
- cmake --build Dist -j 2
test_pcapplusplus_script:
- python3 -m pip install gcovr
- python3 -m pip install -r ci/run_tests/requirements.txt
- python3 ci/run_tests/run_tests.py --interface eth0
coverage_report_script:
- gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov -v -f coverage.xml -F zstd -F ubuntu2004 -F unittest || true
task:
name: Test Zstd MacOS
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1
configure_script:
- brew install zstd
# Ensure user have access to network devices instead of giving super-user right
- sudo chmod a+rw /dev/bpf*
- cmake -DLIGHT_PCAPNG_ZSTD=ON -DPCAPPP_BUILD_COVERAGE=ON -S . -B Dist
build_script:
- cmake --build Dist -j 2
install_tcpreplay_gcovr_script:
- brew install tcpreplay gcovr
test_pcapplusplus_script:
- python3 -m ensurepip
- python3 -m pip install -r ci/run_tests/requirements.txt
- python3 ci/run_tests/run_tests.py --interface en0 --test-args="-x TestPcapLiveDeviceSpecialCfg"
coverage_report_script:
- gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- curl -Os https://uploader.codecov.io/latest/macos/codecov
- chmod +x codecov
- ./codecov -v -f coverage.xml -F zstd -F macos-ventura -F unittest || true
task:
name: Regression Tests Linux (Address Sanitizer)
container:
image: gcr.io/oss-fuzz-base/base-clang
configure_script:
- apt-get update && apt-get install -y cmake git libpcap-dev
- cmake -S . -B $BUILD_DIR -DPCAPPP_USE_SANITIZER=AddressSanitizer -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_EXAMPLES=OFF
build_script:
- cmake --build $BUILD_DIR -j 2
test_script:
- export BINARY="$BUILD_DIR/Tests/Fuzzers/FuzzTarget"
- export SAMPLES="Tests/Fuzzers/RegressionTests/regression_samples"
- Tests/Fuzzers/RegressionTests/run_tests.sh
# Compilation failed due too issue w/ MemPlumber
# task:
# name: Regression Tests Linux (Memory Sanitizer)
# container:
# image: gcr.io/oss-fuzz-base/base-clang
# configure_script:
# - apt-get update && apt-get install -y cmake git libpcap-dev
# - cmake -S . -B $BUILD_DIR -DPCAPPP_USE_SANITIZER=MemorySanitizer -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_EXAMPLES=OFF
# build_script:
# - cmake --build $BUILD_DIR -j 2
# test_script:
# - export BINARY="$BUILD_DIR/Tests/Fuzzers/FuzzTarget"
# - export SAMPLES="Tests/Fuzzers/RegressionTests/regression_samples"
# - Tests/Fuzzers/RegressionTests/run_tests.sh
task:
name: Regression Tests Linux (Undefined Behavior Sanitizer)
container:
image: gcr.io/oss-fuzz-base/base-clang
configure_script:
- apt-get update && apt-get install -y cmake git libpcap-dev
- cmake -S . -B $BUILD_DIR -DPCAPPP_USE_SANITIZER=UndefinedBehaviorSanitizer -DPCAPPP_BUILD_FUZZERS=ON -DPCAPPP_BUILD_EXAMPLES=OFF
build_script:
- cmake --build $BUILD_DIR -j 2
test_script:
- export BINARY="$BUILD_DIR/Tests/Fuzzers/FuzzTarget"
- export SAMPLES="Tests/Fuzzers/RegressionTests/regression_samples"
- Tests/Fuzzers/RegressionTests/run_tests.sh
task:
name: Build Doxygen Documentation
container:
image: seladb/ubuntu1804:latest
env:
- GITHUB_EMAIL: ENCRYPTED[ae4956ec74c9f329f7787cdfe3a6b5842870659275d0a9b513a0f6e64cd9c71cd2eb64219a9dc695f446fbd93c48fb04]
- GITHUB_TOKEN: ENCRYPTED[ab88249da2005c70f25f5910b08e907139f73bc0efb31a19b33f832e9e3bffe3cfc8e81932f21d7734c7aceca2a77188]
get_code_script:
- git clone https://github.com/PcapPlusPlus/pcapplusplus.github.io.git
configure_script:
- cmake -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAPPP_BUILD_TESTS=OFF -B build -S .
build_script:
- cmake --build build -j 2
build_documentation_script:
- cd pcapplusplus.github.io/static/api-docs/next/doxygen
- doxygen Doxyfile-ci
upload_documentation_script: |
if [ "$CIRRUS_BRANCH" == "master" -a "$CIRRUS_REPO_OWNER" == "seladb" ]; then
find pcapplusplus.github.io/static/api-docs/next/ -maxdepth 1 -type f -exec rm {} \;
rm -rf pcapplusplus.github.io/static/api-docs/next/search/
mv pcapplusplus.github.io/static/api-docs/next/html/* pcapplusplus.github.io/static/api-docs/next/
cd pcapplusplus.github.io/static/api-docs/next/
git config user.name "seladb"
git config user.email "${GITHUB_EMAIL}"
git add .
git commit -m "Update API documentation for commit ${CIRRUS_CHANGE_IN_REPO}"
git push --quiet "https://${GITHUB_TOKEN}@github.com/PcapPlusPlus/pcapplusplus.github.io" master
fi