-
Notifications
You must be signed in to change notification settings - Fork 5
184 lines (176 loc) · 7.21 KB
/
build-sola.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
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
name: Build SOLA
on: [push, pull_request]
env:
NS_3_VERSION: ns-3.37
DAISI_OUTPUT_PATH: ${{ github.workspace }}/output
jobs:
formatting_check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check commit messages
run: |
pip install gitlint
gitlint --commits 3fb83ef...HEAD
- name: Check newlines and license
# For Ubuntu, symlink fdfind to fd (https://github.com/sharkdp/fd#on-ubuntu)
run: |
sudo apt-get install -y fd-find
ln -s $(which fdfind) ~/.local/bin/fd
scripts/check_license_and_newline/check_license_and_newline.sh
- name: Check formatting
run: |
find daisi -path daisi/third_party -prune -type f -o -name "*.cpp" -o -name "*.h" >> files.txt
find minhton -path minhton/third_party -prune -type f -o -name "*.cpp" -o -name "*.h" >> files.txt
find natter -path natter/third_party -prune -type f -o -name "*.cpp" -o -name "*.h" >> files.txt
find sola -path sola/third_party -prune -type f -o -name "*.cpp" -o -name "*.h" >> files.txt
find solanet -path solanet/third_party -prune -type f -o -name "*.cpp" -o -name "*.h" >> files.txt
clang-format --style='file:.clang-format' --dry-run --Werror `cat files.txt`
ns-3_compile:
runs-on: ubuntu-22.04
needs: formatting_check
steps:
- name: Check if cache exists
id: cache-exists
uses: actions/cache/restore@v3
with:
path: ~/ns-3_install
key: ns-3_install-${{env.NS_3_VERSION}}
lookup-only: true
- name: Compile ns-3
if: steps.cache-exists.outputs.cache-hit != 'true'
run: |
git clone -b $NS_3_VERSION https://gitlab.com/nsnam/ns-3-dev.git
cd ns-3-dev
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=~/ns-3_install -DNS3_ENABLED_MODULES="core;mobility;applications;network;bridge;csma;wifi"
cmake --build .
cmake --install .
- name: Upload ns-3 to cache
if: steps.cache-exists.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/ns-3_install
key: ns-3_install-${{env.NS_3_VERSION}}
clangtidy:
needs: ns-3_compile
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download ns-3 cache
uses: actions/cache@v3
with:
path: ~/ns-3_install
key: ns-3_install-${{env.NS_3_VERSION}}
fail-on-cache-miss: true
- name: Install dependencies
run: sudo apt-get install -y libyaml-cpp-dev libevent-dev libsqlite3-dev
- name: Configure build
run: |
mkdir build && cd build
cmake ../daisi -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dns3_DIR=~/ns-3_install/lib/cmake/ns3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cd ..
python3 scripts/compile_commands_clean.py build/compile_commands.json third_party tests
- name: Run clang-tidy
run: |
run-clang-tidy -header-filter "(daisi|minhton|natter|sola|solanet)/(src|include|examples).*" -p build
cppcheck:
needs: ns-3_compile
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download ns-3 cache
uses: actions/cache@v3
with:
path: ~/ns-3_install
key: ns-3_install-${{env.NS_3_VERSION}}
fail-on-cache-miss: true
- name: Install dependencies
run: sudo apt-get install -y libyaml-cpp-dev libevent-dev libsqlite3-dev cppcheck
- name: Configure build
run: |
mkdir build && cd build
cmake ../daisi -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dns3_DIR=~/ns-3_install/lib/cmake/ns3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cd ..
python3 scripts/compile_commands_clean.py build/compile_commands.json third_party
- name: Run cppcheck
run: |
cppcheck --enable=all --error-exitcode=2 --std=c++17 --project=build/compile_commands.json -DCPPCHECK_IGNORE -j `nproc` --suppressions-list=cppcheck.conf
build_and_check:
needs: ns-3_compile
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download ns-3 cache
uses: actions/cache@v3
with:
path: ~/ns-3_install
key: ns-3_install-${{env.NS_3_VERSION}}
fail-on-cache-miss: true
- name: Install dependencies
run: sudo apt-get install -y libyaml-cpp-dev libevent-dev libsqlite3-dev cppcheck ninja-build
- name: Build
run: |
mkdir build && cd build
cmake ../daisi -G Ninja -DCMAKE_BUILD_TYPE=Release -Dns3_DIR=~/ns-3_install/lib/cmake/ns3 -DDAISI_ENABLE_COMPILER_WARNINGS=ON -DDAISI_HANDLE_COMPILER_WARNINGS_AS_ERRORS=ON
cmake --build .
- name: Run MINHTON unittest
run: build/sola_mono/minhton/tests/MinhtonAllTests
- name: Run Natter unittest
run: build/sola_mono/natter/tests/NatterAllTests
- name: Run DAISI unittests
run: |
build/tests/unittests/NatterStaticCalculationTest
build/tests/unittests/CPPSAmrMobilityHelperTest
build/tests/unittests/DaisiDatastructureDirectedGraphTest
build/tests/unittests/DaisiDatastructureWeightedDirectedGraphTest
build/tests/unittests/DaisiDatastructureSimpleTemporalNetworkTest
build/tests/unittests/DaisiCppsTaskManagementStnTaskManagement
build/tests/unittests/DaisiCppsLogicalAuctionParticipantState
build/tests/unittests/network_tcp/daisi_network_tcp_framing_manager_test
- name: Run MINHTON integrationtest
run: |
export LD_LIBRARY_PATH=~/ns-3_install/lib
mkdir output
build/src/minhton-ns3/minhton_ns3 --scenario=`pwd`/daisi/utils/ci_scenario_files/minhton_test.yml
python3 evaluation/minhton_verification.py `find output -name '*.db'`
rm -rf output
- name: Run MINHTON Star Cases integrationtest
run: |
export LD_LIBRARY_PATH=~/ns-3_install/lib
mkdir output
build/src/minhton-ns3/minhton_ns3 --scenario=`pwd`/daisi/utils/ci_scenario_files/minhton_cases.yml
python3 evaluation/minhton_verification.py `find output -name '*.db'`
rm -rf output
- name: Run MINHCAST integrationtest
run: |
export LD_LIBRARY_PATH=~/ns-3_install/lib
mkdir output
build/src/natter-ns3/natter_ns3 --scenario=`pwd`/daisi/utils/ci_scenario_files/minhcast_test.yml
python3 evaluation/natter_verification.py `find output -name '*.db'`
rm -rf output
- name: Run CPPS integrationtest
run: |
export LD_LIBRARY_PATH=~/ns-3_install/lib
export MINHTONDIR=$GITHUB_WORKSPACE/minhton
mkdir output
export MINHTONDIR=`pwd`/minhton
build/src/cpps/CPPS_ns3 --scenario=`pwd`/daisi/utils/ci_scenario_files/cpps_test.yml
python3 evaluation/cpps_verification.py `find output -name '*.db'`
rm -rf output
- name: Run ROUND_ROBIN integrationtest
run: |
export LD_LIBRARY_PATH=~/ns-3_install/lib
export MINHTONDIR=$GITHUB_WORKSPACE/minhton
mkdir output
export MINHTONDIR=`pwd`/minhton
build/src/cpps/CPPS_ns3 --scenario=`pwd`/daisi/utils/ci_scenario_files/round_robin_test.yml
rm -rf output