feat(tests): update Dockerfile and CI script for parallel builds and improved caching
All checks were successful
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (ubuntu) (pull_request) Successful in 15m23s
CI Code / Linux (debian) (pull_request) Successful in 15m35s
CI Code / Linux (arch) (pull_request) Successful in 18m11s

This commit is contained in:
2026-01-15 17:20:19 +03:00
parent fa17173e5c
commit bed046e7ed
6 changed files with 86 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
FROM archlinux
ENV TERM=xterm
ENV CC="ccache gcc"
RUN pacman -Syu --noconfirm
# reflector is optional - if it fails due to network issues, continue with default mirrorlist
@@ -12,6 +13,7 @@ RUN pacman -S --needed --noconfirm \
autoconf-archive \
automake \
base-devel \
ccache \
check \
cmake \
cmocka \

View File

@@ -3,11 +3,13 @@ FROM debian:testing
ENV DEBIAN_FRONTEND="noninteractive"
ENV TERM=xterm
ENV CC="ccache gcc"
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
autoconf-archive \
automake \
ccache \
gcc \
git \
libcmocka-dev \

View File

@@ -1,6 +1,9 @@
# Build the latest Fedora image
FROM fedora:latest
ENV TERM=xterm
ENV CC="ccache gcc"
# libmicrohttpd - for stabber
# glibc-locale - to have en_US locale
RUN dnf install -y \
@@ -8,6 +11,7 @@ RUN dnf install -y \
autoconf-archive \
automake \
awk \
ccache \
gcc \
git \
glib2-devel \

View File

@@ -1,12 +1,16 @@
# Build the latest openSUSE Tumbleweed image
FROM opensuse/tumbleweed
ENV TERM=xterm
ENV CC="ccache gcc"
# libmicrohttpd - for stabber
# glibc-locale - to have en_US locale
RUN zypper --non-interactive in --no-recommends \
autoconf \
autoconf-archive \
automake \
ccache \
gcc \
git \
glib2-devel \

View File

@@ -2,11 +2,13 @@ FROM ubuntu:latest
ENV DEBIAN_FRONTEND="noninteractive"
ENV TERM=xterm
ENV CC="ccache gcc"
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
autoconf-archive \
automake \
ccache \
gcc \
git \
libcmocka-dev \

View File

@@ -44,7 +44,7 @@ ARCH="$(uname | tr '[:upper:]' '[:lower:]')"
case "$ARCH" in
linux*)
# Reduced set of configurations for faster CI
# 4 configurations for parallel CI
tests=(
# 1. Full build (all features enabled)
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
@@ -56,15 +56,13 @@ case "$ARCH" in
--disable-python-plugins --without-xscreensaver --disable-omemo-qrcode --disable-gdk-pixbuf"
# 3. No encryption (disable otr, pgp, omemo)
"--disable-pgp --disable-otr --disable-omemo --disable-omemo-qrcode"
# 4. No plugins
"--disable-plugins --disable-c-plugins --disable-python-plugins"
# 5. Default configuration
# 4. Default configuration
""
)
source /etc/profile.d/debuginfod.sh 2>/dev/null || true
;;
darwin*)
# Reduced set of configurations for faster CI
# 4 configurations for parallel CI
tests=(
# 1. Full build (all features enabled)
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
@@ -76,9 +74,7 @@ case "$ARCH" in
--disable-python-plugins"
# 3. No encryption (disable otr, pgp, omemo)
"--disable-pgp --disable-otr --disable-omemo"
# 4. No plugins
"--disable-plugins --disable-c-plugins --disable-python-plugins"
# 5. Default configuration
# 4. Default configuration
""
)
;;
@@ -90,7 +86,7 @@ case "$ARCH" in
# src/event/server_events.c:1454:19: error: universal character names are only valid in C++ and C99
CC="egcc -std=gnu99 -fexec-charset=UTF-8"
# Reduced set of configurations for faster CI
# 4 configurations for parallel CI
tests=(
# 1. Full build (all features enabled)
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
@@ -102,9 +98,7 @@ case "$ARCH" in
--disable-python-plugins"
# 3. No encryption (disable otr, pgp, omemo)
"--disable-pgp --disable-otr --disable-omemo"
# 4. No plugins
"--disable-plugins --disable-c-plugins --disable-python-plugins"
# 5. Default configuration
# 4. Default configuration
""
)
;;
@@ -129,18 +123,73 @@ case "$ARCH" in
;;
esac
for features in "${tests[@]}"
do
echo
echo "--> Building with ./configure ${features} $*"
echo
# Function to build and test a single configuration
build_and_test() {
local features="$1"
local extra_args="$2"
local idx="$3"
local build_dir="build-$idx"
local log_file="build-$idx.log"
# shellcheck disable=SC2086
./configure $features $*
{
echo "=== Build $idx started at $(date) ==="
echo "--> Building in $build_dir with ./configure $features $extra_args"
$MAKE CC="${CC}"
$MAKE check-functional-parallel
mkdir -p "$build_dir"
cd "$build_dir"
./profanity -v
$MAKE clean
# shellcheck disable=SC2086
../configure $features $extra_args
$MAKE CC="${CC}"
$MAKE check-functional-parallel
./profanity -v
$MAKE clean
cd ..
rm -rf "$build_dir"
echo "=== Build $idx completed at $(date) ==="
} > "$log_file" 2>&1
}
# Run all 4 configurations in parallel
echo "Starting parallel builds..."
pids=()
for idx in 1 2 3 4; do
if [ $idx -le ${#tests[@]} ]; then
build_and_test "${tests[$((idx-1))]}" "$*" "$idx" &
pids+=("$!")
echo "Started build $idx (PID: $!)"
fi
done
# Wait for all builds and check exit codes
failed=0
for i in "${!pids[@]}"; do
idx=$((i + 1))
if wait "${pids[$i]}"; then
echo "✓ Build $idx passed"
else
echo "✗ Build $idx failed"
echo "--- Log for build $idx ---"
cat "build-$idx.log"
echo "--- End log ---"
failed=1
fi
done
# Show all logs on success too
if [ $failed -eq 0 ]; then
echo
echo "All builds passed!"
for idx in 1 2 3 4; do
if [ -f "build-$idx.log" ]; then
echo "--- Log for build $idx ---"
cat "build-$idx.log"
fi
done
else
exit 1
fi