summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorDan Nicholson <dbn@endlessos.org>2021-06-18 11:33:56 -0600
committerDan Nicholson <dbn@endlessos.org>2021-06-18 15:30:06 -0600
commita0012ae0eea82d47a83b44a938d621535b7bc2da (patch)
tree14f88f6b42ae986e93c857a8031726dce39f4c9c /ci
parent9ff141fe80f145862c947c3a25d9367c01ebe43c (diff)
downloadostree-a0012ae0eea82d47a83b44a938d621535b7bc2da.tar.gz
ci: Add GitHub Actions workflow for test suite
This runs the test suite in various distros. The intention is to use this to replace the Travis CI setup since it often has rate limit failures. Each configuration in the matrix runs in a Docker container, installs system dependencies and then builds and tests ostree. The scripts are basically copy and paste of the travis ones with some of the lesser used features pruned out. Some differences from the travis setup: * OS details are gathered from `/etc/os-release` instead of being passed in as environment variables. * The scripts always assume the user is root and don't try to use `sudo`. * The `installcheck` test has been removed since ostree doesn't actually use that. It could be added to run the installed tests or `gnome-desktop-testing-runner` could just be called directly. There should be enough flexibility to run other distros like Fedora, Arch or Alpine. Another option would be to use the other build scripts in ci/.
Diffstat (limited to 'ci')
-rwxr-xr-xci/gh-build.sh62
-rwxr-xr-xci/gh-install.sh84
2 files changed, 146 insertions, 0 deletions
diff --git a/ci/gh-build.sh b/ci/gh-build.sh
new file mode 100755
index 00000000..949ce5fa
--- /dev/null
+++ b/ci/gh-build.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Copyright © 2015-2016 Collabora Ltd.
+# Copyright © 2021 Endless OS Foundation LLC
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+set -euo pipefail
+set -x
+
+NOCONFIGURE=1 ./autogen.sh
+
+srcdir="$(pwd)"
+mkdir ci-build
+cd ci-build
+
+make="make V=1 VERBOSE=1"
+
+../configure \
+ --enable-always-build-tests \
+ "$@"
+
+${make}
+
+# Run the tests both using check and distcheck and dump the logs on
+# failures. For distcheck the logs will be inside the dist directory, so
+# tell make to use the current directory.
+if ! ${make} check; then
+ cat test-suite.log || :
+ exit 1
+fi
+if ! ${make} distcheck \
+ TEST_SUITE_LOG=$(pwd)/test-suite.log \
+ DISTCHECK_CONFIGURE_FLAGS="$*"
+then
+ cat test-suite.log || :
+ exit 1
+fi
+
+# Show the installed files
+${make} install DESTDIR=$(pwd)/DESTDIR
+( cd DESTDIR && find . )
+
+# vim:set sw=4 sts=4 et:
diff --git a/ci/gh-install.sh b/ci/gh-install.sh
new file mode 100755
index 00000000..dc0c7fde
--- /dev/null
+++ b/ci/gh-install.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# Copyright © 2015-2016 Collabora Ltd.
+# Copyright © 2021 Endless OS Foundation LLC
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+set -euo pipefail
+set -x
+
+NULL=
+
+# Get the OS release info
+. /etc/os-release
+
+case "$ID" in
+ (debian|ubuntu)
+ # Make debconf run non-interactively since its questions can't
+ # be answered.
+ export DEBIAN_FRONTEND=noninteractive
+
+ # TODO: fetch this list from the Debian packaging git repository?
+ apt-get -y update
+ apt-get -y install \
+ attr \
+ bison \
+ cpio \
+ debhelper \
+ dh-autoreconf \
+ dh-systemd \
+ docbook-xml \
+ docbook-xsl \
+ e2fslibs-dev \
+ elfutils \
+ fuse \
+ gjs \
+ gnome-desktop-testing \
+ gobject-introspection \
+ gtk-doc-tools \
+ libarchive-dev \
+ libattr1-dev \
+ libcap-dev \
+ libcurl4-openssl-dev \
+ libfuse-dev \
+ libgirepository1.0-dev \
+ libglib2.0-dev \
+ libgpgme11-dev \
+ liblzma-dev \
+ libmount-dev \
+ libselinux1-dev \
+ libsoup2.4-dev \
+ libsystemd-dev \
+ procps \
+ python3-yaml \
+ systemd \
+ zlib1g-dev \
+ "$@"
+ ;;
+
+ (*)
+ echo "Don't know how to set up ${ID}" >&2
+ exit 1
+ ;;
+esac
+
+# vim:set sw=4 sts=4 et: