Skip to content

Commit f36241f

Browse files
committed
ci: Add pipeline test
1 parent 4930827 commit f36241f

1 file changed

Lines changed: 263 additions & 0 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
# ─────────────────────────────────────────────────────────────────────────────
2+
# ns-O-RAN-flexric – CI/CD Pipeline
3+
# Trigger : workflow_dispatch (triggered manually from the GitHub Actions UI)
4+
# Runner : ubuntu-latest (Ubuntu 24.04)
5+
6+
name: ns-O-RAN-flexric CI
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- CI/CD_tests
13+
- main
14+
15+
jobs:
16+
17+
install-deps:
18+
name: "Install Base Dependencies"
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
23+
- name: Update package list and install all required dependencies
24+
run: |
25+
sudo apt-get update
26+
27+
# ── E2SIM requirements ───────────────────────────────────────────
28+
sudo apt-get install -y \
29+
build-essential \
30+
git \
31+
cmake \
32+
libsctp-dev \
33+
autoconf \
34+
automake \
35+
libtool \
36+
bison \
37+
flex \
38+
libboost-all-dev
39+
40+
# ── ns-3 requirements ────────────────────────────────────────────
41+
# Note: the package name on Ubuntu is g++-13, not g++13.
42+
sudo apt-get install -y \
43+
g++-13 \
44+
python3.8 \
45+
libc6-dev
46+
47+
# ── Optional: SQLite (LENA comparison examples) ──────────────────
48+
sudo apt-get install -y sqlite3 libsqlite3-dev
49+
50+
# ── Optional: Eigen3 (MIMO features) ────────────────────────────
51+
sudo apt-get install -y libeigen3-dev
52+
53+
# ───────────────────────────────────────────────────────────────────────────
54+
# JOB 1 – E2SIM
55+
# ───────────────────────────────────────────────────────────────────────────
56+
57+
test-e2sim:
58+
name: "E2SIM Build"
59+
runs-on: ubuntu-latest
60+
needs: [install-deps]
61+
62+
steps:
63+
64+
- name: Checkout repository with submodules
65+
uses: actions/checkout@v4
66+
with:
67+
submodules: recursive
68+
69+
- name: Install E2SIM build dependencies
70+
run: |
71+
sudo apt-get update
72+
sudo apt-get install -y \
73+
build-essential git cmake \
74+
libsctp-dev autoconf automake libtool \
75+
bison flex libboost-all-dev g++
76+
77+
- name: Set up Python 3.13
78+
uses: actions/setup-python@v5
79+
with:
80+
python-version: "3.13"
81+
82+
- name: Create build directory
83+
working-directory: e2sim-kpmv3/e2sim
84+
run: mkdir -p build
85+
86+
- name: Build E2SIM
87+
working-directory: e2sim-kpmv3/e2sim
88+
run: sudo ./build_e2sim.sh 3
89+
90+
- name: Upload e2sim build artifact
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: e2sim-build
94+
path: e2sim-kpmv3/
95+
retention-days: 1
96+
97+
# ───────────────────────────────────────────────────────────────────────────
98+
# JOB 2 – FlexRIC
99+
# ───────────────────────────────────────────────────────────────────────────
100+
test-flexric:
101+
name: "FlexRIC Build & Install"
102+
runs-on: ubuntu-latest
103+
needs: [install-deps]
104+
105+
steps:
106+
107+
- name: Install base apt prerequisites
108+
run: |
109+
sudo apt-get update
110+
sudo apt-get install -y \
111+
build-essential git \
112+
libsctp-dev libssl-dev \
113+
cmake-curses-gui libpcre2-dev \
114+
python3-dev python3.8 \
115+
libconfig-dev libconfig++-dev \
116+
autoconf automake libtool
117+
118+
- name: Install CMake ≥ 3.22 (Kitware APT repo)
119+
run: |
120+
sudo apt-get install -y ca-certificates gpg wget
121+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
122+
| gpg --dearmor - \
123+
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null
124+
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] \
125+
https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
126+
| sudo tee /etc/apt/sources.list.d/kitware.list
127+
sudo apt-get update
128+
sudo apt-get install -y cmake
129+
cmake --version
130+
131+
- name: Install SWIG 4.1
132+
run: |
133+
git clone https://github.com/swig/swig.git
134+
cd swig
135+
git checkout release-4.1
136+
./autogen.sh
137+
./configure --prefix=/usr/
138+
make -j$(nproc)
139+
sudo make install
140+
swig -version
141+
142+
- name: Install GCC-13 and set as default compiler
143+
run: |
144+
sudo apt-get install -y gcc-13 g++-13
145+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130
146+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
147+
gcc --version
148+
g++ --version
149+
150+
- name: Install asn1c
151+
run: |
152+
sudo apt-get remove -y asn1c || true
153+
sudo apt-get install -y git autoconf automake libtool make gcc g++ m4
154+
sudo git clone https://github.com/mouse07410/asn1c /tmp/asn1c
155+
cd /tmp/asn1c
156+
sudo git checkout 940dd5fa9f3917913fd487b13dfddfacd0ded06e
157+
sudo autoreconf -iv
158+
sudo ./configure --prefix=/opt/asn1c
159+
sudo make -j$(nproc)
160+
sudo make install
161+
sudo rm -rf /tmp/asn1c
162+
echo "/opt/asn1c/bin" >> "$GITHUB_PATH"
163+
/opt/asn1c/bin/asn1c -version
164+
165+
166+
- name: Clone FlexRIC
167+
run: |
168+
git clone https://gitlab.eurecom.fr/mosaic5g/flexric.git
169+
cd flexric
170+
git checkout dev
171+
git checkout d3dc645b4
172+
173+
174+
- name: Configure FlexRIC (E2AP_V1 / KPM_V3_00)
175+
working-directory: flexric
176+
run: |
177+
mkdir build
178+
cd build
179+
cmake .. \
180+
-DE2AP_VERSION=E2AP_V1 \
181+
-DKPM_VERSION=KPM_V3_00
182+
183+
- name: Build FlexRIC
184+
working-directory: flexric/build
185+
run: make -j8
186+
187+
- name: Install FlexRIC Service Models and package for artifact
188+
working-directory: flexric/build
189+
run: |
190+
sudo make install
191+
sudo make DESTDIR=/tmp/flexric-install install
192+
tar czf /tmp/flexric-installed.tar.gz -C /tmp/flexric-install .
193+
194+
- name: Upload FlexRIC installed files artifact
195+
uses: actions/upload-artifact@v4
196+
with:
197+
name: flexric-install
198+
path: /tmp/flexric-installed.tar.gz
199+
retention-days: 1
200+
201+
# ───────────────────────────────────────────────────────────────────────────
202+
# JOB 3 – ns-3
203+
# ───────────────────────────────────────────────────────────────────────────
204+
test-ns3:
205+
name: "ns-3 mmWave Build"
206+
runs-on: ubuntu-latest
207+
needs: [test-e2sim, test-flexric]
208+
209+
steps:
210+
211+
- name: Checkout repository
212+
uses: actions/checkout@v4
213+
- name: Initialise mmwave-LENA-oran submodule
214+
run: |
215+
git submodule init
216+
git submodule update --recursive -- mmwave-LENA-oran
217+
echo "mmwave-LENA-oran contents:"
218+
ls mmwave-LENA-oran/
219+
220+
- name: Install system build dependencies
221+
run: |
222+
sudo apt-get update
223+
sudo apt-get install -y \
224+
build-essential git cmake \
225+
libsctp-dev libssl-dev \
226+
libpcre2-dev \
227+
python3-dev python3.8 \
228+
libconfig-dev libconfig++-dev
229+
230+
- name: Install GCC-13 and set as default compiler
231+
run: |
232+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130
233+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
234+
235+
- name: Set up Python 3.13
236+
uses: actions/setup-python@v5
237+
with:
238+
python-version: "3.13"
239+
240+
- name: Download e2sim build artifact
241+
uses: actions/download-artifact@v4
242+
with:
243+
name: e2sim-build
244+
path: e2sim-kpmv3/
245+
246+
- name: Download FlexRIC installed files artifact
247+
uses: actions/download-artifact@v4
248+
with:
249+
name: flexric-install
250+
path: ${{ github.workspace }}
251+
252+
- name: Restore FlexRIC installed files to system paths
253+
run: |
254+
sudo tar xzf flexric-installed.tar.gz -C /
255+
sudo ldconfig
256+
257+
- name: Configure ns-3
258+
working-directory: mmwave-LENA-oran
259+
run: ./ns3 configure --disable-python --enable-examples
260+
261+
- name: Build ns-3
262+
working-directory: mmwave-LENA-oran
263+
run: ./ns3 build

0 commit comments

Comments
 (0)