@@ -175,3 +175,107 @@ jobs:
175175 # Run the testsuite
176176 git clone --depth=1 https://github.com/lxc/lxc-ci
177177 sudo -E lxc-ci/deps/lxc-exercise
178+
179+ codecov :
180+ name : Codecov
181+ strategy :
182+ fail-fast : false
183+ runs-on : ubuntu-24.04
184+ steps :
185+ - name : Checkout code
186+ uses : actions/checkout@v6
187+
188+ - name : Install dependencies
189+ run : |
190+ sudo apt-get update -qq
191+ sudo apt-get install -qq \
192+ gcc \
193+ meson \
194+ pkg-config \
195+ uuid-runtime \
196+ docbook2x \
197+ linux-libc-dev \
198+ libapparmor-dev \
199+ libcap-dev \
200+ libdbus-1-dev \
201+ libpam0g-dev \
202+ libseccomp-dev \
203+ libselinux1-dev \
204+ liburing-dev
205+
206+ - name : Compiler version
207+ env :
208+ CC : gcc
209+ run : |
210+ ${CC} --version
211+
212+ - name : Build
213+ env :
214+ CC : gcc
215+ run : |
216+ # Landlock support
217+ landlock=false
218+ if [ -e /usr/include/linux/landlock.h ]; then
219+ landlock=true
220+ fi
221+
222+ # Standard build with gcov (b_coverage=true)
223+ meson setup build \
224+ -Dprefix=/usr \
225+ -Dio-uring-event-loop=${{ matrix.async-api == 'io_uring' }} \
226+ -Dtests=true \
227+ -Dpam-cgroup=true \
228+ -Dtools-multicall=true \
229+ -Dlandlock-monitor=${landlock} \
230+ -Dwerror=true \
231+ -Db_lto_mode=default \
232+ -Db_coverage=true
233+
234+ meson compile -C build
235+
236+ - name : Remove existing installation
237+ run : |
238+ sudo apt-get remove --purge -qq \
239+ liblxc1 \
240+ liblxc-common \
241+ liblxc-dev \
242+ lxc-utils
243+
244+ - name : Install dependencies
245+ run : |
246+ sudo apt-get install --purge -qq \
247+ apparmor \
248+ acl \
249+ busybox-static \
250+ dnsmasq-base \
251+ iptables \
252+ rsync \
253+ uidmap
254+
255+ - name : Test
256+ env :
257+ CC : ${{ matrix.compiler }}
258+ run : |
259+ # Install LXC on the system
260+ sudo meson install -C build
261+
262+ # Bring up systemd units
263+ sudo sed -i 's/USE_LXC_BRIDGE="false"/USE_LXC_BRIDGE="true"/' /etc/default/lxc
264+ sudo systemctl daemon-reload
265+ sudo systemctl restart apparmor
266+ sudo systemctl restart lxc-net
267+
268+ # Undo default ACLs from Github
269+ sudo setfacl -b -R /home
270+
271+ # Run the testsuite
272+ git clone --depth=1 https://github.com/lxc/lxc-ci
273+ sudo -E lxc-ci/deps/lxc-exercise
274+
275+ ninja -C build coverage
276+
277+ - name : Upload coverage reports to Codecov
278+ uses : codecov/codecov-action@v5
279+ with :
280+ token : ${{ secrets.CODECOV_TOKEN }}
281+ verbose : true
0 commit comments