Skip to content

Commit

Permalink
ci: Add build test for Ubuntu Focal
Browse files Browse the repository at this point in the history
This is to ensure the software continues to build on (somewhat old)
"Ubuntu Focal"-based distros. At the moment, package "libfsverity-dev"
is not available on that distro, so make its installation optional.

Signed-off-by: Rogerio Guerra Borin <[email protected]>
  • Loading branch information
rborn-tx committed Feb 11, 2024
1 parent 384f306 commit 453eaef
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ jobs:
with:
name: composefs.tar
path: composefs.tar
build-baseline:
runs-on: ubuntu-latest
name: "Build on Ubuntu Focal"
container: ubuntu:focal
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update -y
ALLOW_MISSING="libfsverity-dev" ./hacking/installdeps.sh
- name: Configure
run: |
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) CFLAGS='-Wall -Werror'
- name: Build
run: make -j $(nproc) CFLAGS='-fsanitize=address -fsanitize=undefined'
build-unit-cross:
runs-on: ubuntu-latest
name: Build on ${{ matrix.arch }}
Expand Down
38 changes: 37 additions & 1 deletion hacking/installdeps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
#!/bin/bash
set -xeuo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get install -y automake libtool autoconf autotools-dev git make gcc libssl-dev libfsverity-dev pkg-config libfuse3-dev python3 libcap2-bin

PACKAGES=" \
automake \
libtool \
autoconf \
autotools-dev \
git \
make \
gcc \
libssl-dev \
libfsverity-dev \
pkg-config \
libfuse3-dev \
python3 \
libcap2-bin \
"

# Split required and optional packages based on input variable ALLOW_MISSING:
PACKAGES_REQUIRED=""
PACKAGES_OPTIONAL=""

for pkg in $PACKAGES; do
if [[ " ${ALLOW_MISSING:-} " == *" ${pkg} "* ]]; then
PACKAGES_OPTIONAL+=" ${pkg}"
else
PACKAGES_REQUIRED+=" ${pkg}"
fi
done

# Install packages:
if [ -n "${PACKAGES_REQUIRED}" ]; then
apt-get install -y $PACKAGES_REQUIRED
fi

if [ -n "${PACKAGES_OPTIONAL}" ]; then
apt-get install -y --ignore-missing $PACKAGES_OPTIONAL || true
fi

0 comments on commit 453eaef

Please sign in to comment.