summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci-debian-build-test.yml72
-rw-r--r--shell.nix65
-rw-r--r--src/modes/thread_index/query_loader.cc2
-rw-r--r--tests/test_composed_message.cc6
4 files changed, 141 insertions, 4 deletions
diff --git a/.github/workflows/ci-debian-build-test.yml b/.github/workflows/ci-debian-build-test.yml
new file mode 100644
index 0000000..d5f2ff7
--- /dev/null
+++ b/.github/workflows/ci-debian-build-test.yml
@@ -0,0 +1,72 @@
+---
+name: "CI: Debian & Derivatives"
+on:
+ - push
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ container: ${{ matrix.container }}
+ strategy:
+ fail-fast: false
+ matrix:
+ container:
+ - 'debian:sid'
+ - 'debian:stable'
+ - 'ubuntu:devel'
+ - 'ubuntu:focal'
+ - 'ubuntu:bionic'
+ timeout-minutes: 15
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v2
+ - name: Install build dependencies
+ env:
+ DEBIAN_FRONTEND: noninteractive
+ run: |
+ echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80-no-recommends
+ apt-get update
+ apt-get -y upgrade
+ apt-get -y install \
+ cmake \
+ cmark \
+ gnupg \
+ libboost-date-time-dev \
+ libboost-filesystem-dev \
+ libboost-log-dev \
+ libboost-program-options-dev \
+ libboost-system-dev \
+ libboost-test-dev \
+ libboost-thread-dev \
+ libgirepository1.0-dev \
+ libglibmm-2.4-dev \
+ libgmime-3.0-dev \
+ libgtkmm-3.0-dev \
+ libnotmuch-dev \
+ libpeas-dev \
+ libprotobuf-dev \
+ libsass-dev \
+ libsoup2.4-dev \
+ libvte-2.91-dev \
+ libwebkit2gtk-4.0-dev \
+ ninja-build \
+ notmuch \
+ pkg-config \
+ protobuf-compiler \
+ python3-gi \
+ w3m \
+ xauth \
+ xvfb
+ # Older releases don't have scdoc, but should have ronn
+ apt-get -y install scdoc || apt-get -y install ruby-ronn
+ - name: "CMake: Configure"
+ run: cmake -H. -Bbuild -GNinja
+ - name: "CMake: Build"
+ run: cmake --build build
+ - name: Run Tests
+ env:
+ HOME: /tmp/home
+ LC_ALL: C.UTF-8
+ run: |
+ mkdir -p $HOME
+ cd build
+ xvfb-run ctest --output-on-failure
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..3f696be
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,65 @@
+{ ... }:
+
+let
+ pkgs = import <nixpkgs> { };
+
+ shell-configure = pkgs.writeShellScriptBin "configure" ''
+ mkdir -p build
+ cd build
+ cmake .. "$@"
+ '';
+
+ shell-build = pkgs.writeShellScriptBin "build" ''
+ if [ ! -d "build" ]; then
+ >&2 echo "First you have to run configure."
+ exit 1
+ fi
+ cd build
+ cmake --build . --parallel $NIX_BUILD_CORES "$@"
+ '';
+
+ shell-run = pkgs.writeShellScriptBin "run" ''
+ if [ ! -f "build/astroid" ]; then
+ >&2 echo "First you have to run build."
+ exit 1
+ fi
+ build/astroid "@"
+ '';
+
+ shell-debug = pkgs.writeShellScriptBin "debug" ''
+ if [ ! -f "build/astroid" ]; then
+ >&2 echo "First you have to run build."
+ exit 1
+ fi
+ gdb --args ./build/astroid "$@"
+ '';
+
+in
+pkgs.mkShell {
+ buildInputs = with pkgs; [
+ shell-configure
+ shell-build
+ shell-run
+ shell-debug
+
+ boost
+ cmake
+ glib-networking protobuf
+ gmime3
+ gnome3.adwaita-icon-theme
+ gsettings-desktop-schemas
+ gtkmm3
+ libpeas
+ libsass
+ notmuch
+ pkgconfig
+ python3
+ python3Packages.pygobject3
+ ronn
+ webkitgtk
+ wrapGAppsHook
+ ];
+
+ LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib";
+}
+
diff --git a/src/modes/thread_index/query_loader.cc b/src/modes/thread_index/query_loader.cc
index 40f384b..39c2fb8 100644
--- a/src/modes/thread_index/query_loader.cc
+++ b/src/modes/thread_index/query_loader.cc
@@ -123,7 +123,7 @@ namespace Astroid {
if (!in_destructor) stats_ready.emit ();
/* set up query */
- notmuch_threads_t * threads;
+ notmuch_threads_t * threads = NULL;
notmuch_query_t * nmquery = notmuch_query_create (db.nm_db, query.c_str ());
for (ustring & t : db.excluded_tags) {
diff --git a/tests/test_composed_message.cc b/tests/test_composed_message.cc
index 792d4d0..4648639 100644
--- a/tests/test_composed_message.cc
+++ b/tests/test_composed_message.cc
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_SUITE(Composing)
ComposeMessage * c = new ComposeMessage ();
- ustring bdy = "This is test: æøå.\n > testing\ntesting\n...";
+ ustring bdy = "This is test: æøå.\n > testing\ntesting\n...\n";
LOG (trace) << "cm: writing utf-8 text to message body: " << bdy;
c->body << bdy;
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_SUITE(Composing)
ComposeMessage * c = new ComposeMessage ();
- ustring bdy = "This is test: æøå.\n > testing\ntesting\n...";
+ ustring bdy = "This is test: æøå.\n > testing\ntesting\n...\n";
LOG (trace) << "cm: writing utf-8 text to message body: " << bdy;
c->body << bdy;
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_SUITE(Composing)
ComposeMessage * c = new ComposeMessage ();
- ustring bdy = "This is test: æøå.\n > testing\ntesting\n...";
+ ustring bdy = "This is test: æøå.\n > testing\ntesting\n...\n";
LOG (trace) << "cm: writing utf-8 text to message body: " << bdy;
c->body << bdy;