Skip to content

Commit 1f77954

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 85192f6 commit 1f77954

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,47 @@ 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+
git clone https://github.com/seccomp/libseccomp
38+
cd libseccomp
39+
git checkout ${{ matrix.libseccomp }}
40+
# In main branch, configure.ac sets libseccomp version to 0.0.0, which
41+
# results in error when compiling libseccomp-golang. While 0.0.0 is
42+
# there for a reason, here we need to build and test against HEAD, so
43+
# set it to a suitable value.
44+
# Version 2.99.999 is used because:
45+
# - version >= current is needed;
46+
# - no need to change it after a new release (until 3.0.0);
47+
# - chances are very high such version won't ever exist;
48+
# - it is easy to spot in tests output.
49+
sed -i '/^AC_INIT(/s/0\.0\.0/2.99.999/' configure.ac
50+
./autogen.sh
51+
./configure --prefix=/usr/local --libdir=/usr/local/lib
52+
make
53+
sudo make install
54+
cd -
55+
rm -rf libseccomp
56+
# For the next steps to use the compiled library, set these env vars.
57+
echo "PKG_CONFIG_DIR=/usr/local/lib/pkgconfig" >> $GITHUB_ENV
58+
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
59+
3660
- name: build
3761
run: make check-build
3862

0 commit comments

Comments
 (0)