Skip to content

Commit 819a37c

Browse files
committed
CI/GHA: test against libseccomp 2.5.2 and HEAD
Instead of testing against whatever version of libseccomp the distro (Ubuntu 20.04 in this case) provides, do compile and test against the latest released version, 2.5.2. While at it, it's relatively easy to enable testing against git tip as well, so implement it as well. All we have to do is to change the version from 0.0.0 to some value that is >= current version. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 2710d8c commit 819a37c

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,54 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
go-version: [1.15.x, 1.16.x, 1.17.x]
19+
libseccomp: ["v2.5.2", "HEAD"]
1920

2021
steps:
2122

2223
- name: checkout
2324
uses: actions/checkout@v2
2425

25-
- name: install deps
26-
run: |
27-
sudo apt -q update
28-
sudo apt -q install libseccomp-dev
29-
3026
- name: install go ${{ matrix.go-version }}
3127
uses: actions/setup-go@v2
3228
with:
3329
stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")'
3430
go-version: ${{ matrix.go-version }}
3531

32+
- name: build libseccomp ${{ matrix.libseccomp }}
33+
run: |
34+
set -x
35+
sudo apt -qq update
36+
sudo apt -qq install gperf
37+
38+
PREFIX="$(pwd)/seccomp"
39+
LIBDIR="$PREFIX/lib"
40+
41+
git clone https://github.com/seccomp/libseccomp
42+
cd libseccomp
43+
git checkout ${{ matrix.libseccomp }}
44+
# In main branch, configure.ac sets libseccomp version to 0.0.0, which
45+
# results in error when compiling libseccomp-golang. While 0.0.0 is
46+
# there for a reason, here we need to build and test against HEAD, so
47+
# set it to a suitable value.
48+
#
49+
# Version 9.9.9 is used because:
50+
# - version >= current is needed;
51+
# - chances are good such version won't ever exist;
52+
# - it is easy to spot in tests output;
53+
# - the LIBFILE pattern below expects single digits.
54+
sed -i '/^AC_INIT(/s/0\.0\.0/9.9.9/' configure.ac
55+
./autogen.sh
56+
./configure --prefix="$PREFIX" --libdir="$LIBDIR"
57+
make
58+
sudo make install
59+
cd -
60+
rm -rf libseccomp
61+
62+
# For the next steps to build and execute with the compiled library.
63+
echo "PKG_CONFIG_LIBDIR=$LIBDIR/pkgconfig" >> $GITHUB_ENV
64+
LIBFILE="$(echo $LIBDIR/libseccomp.so.?.?.?)"
65+
echo "LD_PRELOAD=$LIBFILE" >> $GITHUB_ENV
66+
3667
- name: build
3768
run: make check-build
3869

0 commit comments

Comments
 (0)