Skip to content

Commit b9b0628

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. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent cd8732a commit b9b0628

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,53 @@ 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+
# Version 2.99.999 is used because:
49+
# - version >= current is needed;
50+
# - no need to change it after a new release (until 3.0.0);
51+
# - chances are very high such version won't ever exist;
52+
# - it is easy to spot in tests output.
53+
sed -i '/^AC_INIT(/s/0\.0\.0/2.99.999/' configure.ac
54+
./autogen.sh
55+
./configure --prefix="$PREFIX" --libdir="$LIBDIR"
56+
make
57+
sudo make install
58+
cd -
59+
rm -rf libseccomp
60+
61+
# For the next steps to build and execute with the compiled library.
62+
echo "PKG_CONFIG_LIBDIR=$LIBDIR/pkgconfig" >> $GITHUB_ENV
63+
LIBFILE="$(echo $LIBDIR/libseccomp.so.?.?.?)"
64+
echo "LD_PRELOAD=$LIBFILE" >> $GITHUB_ENV
65+
3666
- name: build
3767
run: make check-build
3868

0 commit comments

Comments
 (0)