Skip to content

Commit 2b80032

Browse files
committed
wip: Debian validate workflow
Install dependencies described in debian/control file, build package and run basic tests with installed result Signed-off-by: Pavel Shramov <[email protected]>
1 parent 99f85e3 commit 2b80032

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Validate Debian build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-24.04]
10+
runs-on: ${{ matrix.os }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
submodules: recursive
16+
- uses: actions/cache@v4
17+
with:
18+
path: |
19+
/home/runner/.ccache
20+
/home/runner/.cache/ccache
21+
key: debian-validate:${{ matrix.os }}:${{ github.sha }}
22+
restore-keys: 'debian-validate:${{ matrix.os }}:'
23+
- name: disable man-db trigger # See https://github.com/actions/runner-images/issues/10977
24+
run: |
25+
echo "set man-db/auto-update false" | sudo debconf-communicate
26+
sudo dpkg-reconfigure man-db
27+
- name: install deps
28+
run: |
29+
ln -s build/debian debian
30+
sudo apt update
31+
sudo apt remove --yes libpython3*-dev # By default github images have python3-dev packages installed, drop them
32+
sudo apt install --yes build-essential ccache
33+
sudo apt satisfy --yes --no-install-recommends "`perl ./debian/print-build-deps.pl`"
34+
- name: build
35+
env:
36+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
37+
CMAKE_C_COMPILER_LAUNCHER: ccache
38+
run: dpkg-buildpackage --no-sign -b -j4
39+
- name: test
40+
continue-on-error: true
41+
run: |
42+
set -x
43+
test ! -f /opt/xilinix/xrt/bin/xclbinutil
44+
if pkg-config --exists xrt; then echo "XRT pkg-config file installed: `pkg-config --modversion xrt`"; false; else true; fi
45+
sudo dpkg -i ../xrt_*.deb
46+
test -f /opt/xilinx/xrt/bin/xclbinutil
47+
pkg-config --exists xrt
48+
mkdir build-test
49+
cd build-test
50+
c++ -ohello `pkg-config --cflags --libs xrt` -Wall ../tests/xrt/00_hello/main.cpp
51+
52+
# vim: sts=2 sw=2 et

build/debian/print-build-deps.pl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/perl
2+
3+
use strict;
4+
use warnings;
5+
6+
use Dpkg::Control::Info;
7+
use Dpkg::Deps;
8+
9+
my $fields = Dpkg::Control::Info->new()->get_source();
10+
my %options = (reduce_restrictions => 1);
11+
12+
print(deps_concat(
13+
deps_parse($fields->{'Build-Depends'}, %options),
14+
deps_parse($fields->{'Build-Depends-Arch'} || '', %options) || undef,
15+
deps_parse($fields->{'Build-Depends-Indep'} || '', %options) || undef,
16+
))

0 commit comments

Comments
 (0)