Skip to content

Commit 4223105

Browse files
committed
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.
1 parent 57d18d4 commit 4223105

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ jobs:
2626
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
2727
docker run profanity ./ci-build.sh
2828
29+
linux-meson:
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
matrix:
34+
flavor: [debian]
35+
36+
name: Linux-meson
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Run tests
40+
run: |
41+
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
42+
docker run profanity ./ci-meson-build.sh
43+
2944
code-style:
3045
runs-on: ubuntu-22.04
3146
name: Check coding style

Dockerfile.debian

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55
autoconf \
66
autoconf-archive \
77
automake \
8+
cmake \
89
expect \
910
gcc \
1011
git \
@@ -13,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1314
libgcrypt-dev \
1415
libglib2.0-dev \
1516
libgpgme11-dev \
16-
libgtk2.0-dev \
17+
libgtk-3-dev \
1718
libmicrohttpd-dev \
1819
libncursesw5-dev \
1920
libnotify-dev \
@@ -24,6 +25,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2425
libtool \
2526
libxss-dev \
2627
make \
28+
meson \
29+
ninja-build \
2730
pkg-config \
2831
python3-dev \
2932
python-dev-is-python3 \

ci-meson-build.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on error
4+
set -e
5+
6+
error_handler()
7+
{
8+
ERR_CODE=$?
9+
echo
10+
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
11+
# Meson logs are stored in the build directory
12+
if [ -f "build/meson-logs/testlog.txt" ]; then
13+
echo "--- Meson Test Log ---"
14+
cat build/meson-logs/testlog.txt
15+
fi
16+
exit ${ERR_CODE}
17+
}
18+
19+
trap error_handler ERR
20+
21+
tests=(
22+
"-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"
23+
""
24+
"-Dnotifications=disabled"
25+
"-Dicons-and-clipboard=disabled"
26+
"-Dotr=disabled"
27+
"-Dpgp=disabled"
28+
"-Domemo=disabled -Domemo-qrcode=disabled"
29+
"-Dpgp=disabled -Dotr=disabled"
30+
"-Dpgp=disabled -Dotr=disabled -Domemo=disabled"
31+
"-Dpython-plugins=disabled"
32+
"-Dc-plugins=disabled"
33+
"-Dc-plugins=disabled -Dpython-plugins=disabled"
34+
"-Dxscreensaver=disabled"
35+
"-Dgdk-pixbuf=disabled"
36+
)
37+
38+
# Run Valgrind check (Only on Linux, on first/full feature set)
39+
if [[ "$(uname | tr '[:upper:]' '[:lower:]')" == linux* ]]; then
40+
echo "--> Running Valgrind check with full features"
41+
42+
meson setup build_valgrind ${tests[0]} -Dtests=true
43+
meson compile -C build_valgrind
44+
45+
meson test -C build_valgrind --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected"
46+
47+
rm -rf build_valgrind
48+
fi
49+
50+
# Iterate through all feature combinations
51+
for features in "${tests[@]}"
52+
do
53+
echo "----------------------------------------------------"
54+
echo "--> Building with: ${features}"
55+
echo "----------------------------------------------------"
56+
57+
rm -rf build_run
58+
59+
meson setup build_run ${features} -Dtests=true
60+
meson compile -C build_run
61+
62+
meson test -C build_run --print-errorlogs
63+
64+
./build_run/profanity -v
65+
done

0 commit comments

Comments
 (0)