ci: add ci job for building with meson
This probably could be nicer. But since we will drop one in the future it's not really a priority to make this pretty.
This commit is contained in:
15
.github/workflows/main.yml
vendored
15
.github/workflows/main.yml
vendored
@@ -26,6 +26,21 @@ jobs:
|
||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||
docker run profanity ./ci-build.sh
|
||||
|
||||
linux-meson:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [debian]
|
||||
|
||||
name: Linux-meson
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||
docker run profanity ./ci-meson-build.sh
|
||||
|
||||
code-style:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Check coding style
|
||||
|
||||
@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
automake \
|
||||
cmake \
|
||||
expect \
|
||||
gcc \
|
||||
git \
|
||||
@@ -13,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libgcrypt-dev \
|
||||
libglib2.0-dev \
|
||||
libgpgme11-dev \
|
||||
libgtk2.0-dev \
|
||||
libgtk-3-dev \
|
||||
libmicrohttpd-dev \
|
||||
libncursesw5-dev \
|
||||
libnotify-dev \
|
||||
@@ -24,6 +25,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libtool \
|
||||
libxss-dev \
|
||||
make \
|
||||
meson \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3-dev \
|
||||
python-dev-is-python3 \
|
||||
|
||||
65
ci-meson-build.sh
Executable file
65
ci-meson-build.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Exit on error
|
||||
set -e
|
||||
|
||||
error_handler()
|
||||
{
|
||||
ERR_CODE=$?
|
||||
echo
|
||||
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
|
||||
# Meson logs are stored in the build directory
|
||||
if [ -f "build/meson-logs/testlog.txt" ]; then
|
||||
echo "--- Meson Test Log ---"
|
||||
cat build/meson-logs/testlog.txt
|
||||
fi
|
||||
exit ${ERR_CODE}
|
||||
}
|
||||
|
||||
trap error_handler ERR
|
||||
|
||||
tests=(
|
||||
"-Dnotifications=enabled -Dicons-and-clipboard=enabled -Dotr=enabled -Dpgp=enabled -Domemo=enabled -Dc-plugins=enabled -Dpython-plugins=enabled -Dxscreensaver=enabled -Domemo-qrcode=enabled -Dgdk-pixbuf=enabled"
|
||||
""
|
||||
"-Dnotifications=disabled"
|
||||
"-Dicons-and-clipboard=disabled"
|
||||
"-Dotr=disabled"
|
||||
"-Dpgp=disabled"
|
||||
"-Domemo=disabled -Domemo-qrcode=disabled"
|
||||
"-Dpgp=disabled -Dotr=disabled"
|
||||
"-Dpgp=disabled -Dotr=disabled -Domemo=disabled"
|
||||
"-Dpython-plugins=disabled"
|
||||
"-Dc-plugins=disabled"
|
||||
"-Dc-plugins=disabled -Dpython-plugins=disabled"
|
||||
"-Dxscreensaver=disabled"
|
||||
"-Dgdk-pixbuf=disabled"
|
||||
)
|
||||
|
||||
# Run Valgrind check (Only on Linux, on first/full feature set)
|
||||
if [[ "$(uname | tr '[:upper:]' '[:lower:]')" == linux* ]]; then
|
||||
echo "--> Running Valgrind check with full features"
|
||||
|
||||
meson setup build_valgrind ${tests[0]} -Dtests=true
|
||||
meson compile -C build_valgrind
|
||||
|
||||
meson test -C build_valgrind --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected"
|
||||
|
||||
rm -rf build_valgrind
|
||||
fi
|
||||
|
||||
# Iterate through all feature combinations
|
||||
for features in "${tests[@]}"
|
||||
do
|
||||
echo "----------------------------------------------------"
|
||||
echo "--> Building with: ${features}"
|
||||
echo "----------------------------------------------------"
|
||||
|
||||
rm -rf build_run
|
||||
|
||||
meson setup build_run ${features} -Dtests=true
|
||||
meson compile -C build_run
|
||||
|
||||
meson test -C build_run --print-errorlogs
|
||||
|
||||
./build_run/profanity -v
|
||||
done
|
||||
Reference in New Issue
Block a user