Skip to content

Commit d33fa79

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 d33fa79

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: install deps
24+
run: |
25+
ln -s build/debian debian
26+
sudo apt update
27+
sudo apt remove --yes libpython3*-dev # By default github images have python3-dev packages installed, drop them
28+
sudo apt install --yes build-essential ccache
29+
sudo apt satisfy --yes --no-install-recommends "`perl ./debian/print-build-deps.pl`"
30+
- name: build
31+
env:
32+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
33+
CMAKE_C_COMPILER_LAUNCHER: ccache
34+
run: dpkg-buildpackage --no-sign -b -j4
35+
- name: test
36+
continue-on-error: true
37+
run: |
38+
set -x
39+
test ! -f /opt/xilinix/xrt/bin/xclbinutil
40+
if pkg-config --exists xrt; then echo "XRT pkg-config file installed: `pkg-config --modversion xrt`"; false; else true; fi
41+
sudo dpkg -i ../xrt_*.deb
42+
test -f /opt/xilinx/xrt/bin/xclbinutil
43+
pkg-config --exists xrt
44+
mkdir build-test
45+
cd build-test
46+
c++ -ohello `pkg-config --cflags --libs xrt` -Wall ../tests/xrt/00_hello/main.cpp
47+
48+
# 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)