aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-07-31 00:23:15 +0200
committerKenny Levinsen <kl@kl.wtf>2020-07-31 00:23:15 +0200
commit1dbd92030724ff1e9df58291722d33d2d89fbc12 (patch)
tree56169a2deb8ef837278dd10af5f753de14b09b1e
parent3b32bd539bfa0daf169559e009f3e9aa6140f4ce (diff)
ci: Initial CI
-rw-r--r--.builds/alpine.yml26
-rw-r--r--.builds/archlinux.yml28
-rwxr-xr-x.builds/smoketest-builtin.sh21
-rwxr-xr-x.builds/smoketest-seatd.sh44
4 files changed, 119 insertions, 0 deletions
diff --git a/.builds/alpine.yml b/.builds/alpine.yml
new file mode 100644
index 0000000..0075534
--- /dev/null
+++ b/.builds/alpine.yml
@@ -0,0 +1,26 @@
+image: alpine/edge
+packages:
+ - meson
+ - linux-headers
+ - clang
+ - clang-analyzer
+sources:
+ - https://git.sr.ht/~kennylevinsen/seatd
+tasks:
+ - prepare: |
+ cd seatd
+ meson build -Dseatd=enabled -Dbuiltin=enabled -Dlogind=disabled
+ - build: |
+ cd seatd
+ ninja -C build
+ - scan-build: |
+ cd seatd
+ ninja -C build scan-build
+ [ -z "$(ls -A build/meson-logs/scanbuild/ 2>/dev/null)" ]
+ - smoketest: |
+ cd seatd
+ timeout -s KILL 30s ./.builds/smoketest-seatd.sh
+ - check-format: |
+ cd seatd
+ ninja -C build clang-format
+ git diff --exit-code
diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml
new file mode 100644
index 0000000..4eda0a8
--- /dev/null
+++ b/.builds/archlinux.yml
@@ -0,0 +1,28 @@
+image: archlinux
+packages:
+ - meson
+ - linux-headers
+ - clang
+ - clang-analyzer
+sources:
+ - https://git.sr.ht/~kennylevinsen/seatd
+tasks:
+ - prepare: |
+ cd seatd
+ meson -Dlogind=enabled -Dseatd=enabled -Dbuiltin=enabled build
+ - build: |
+ cd seatd
+ ninja -C build
+ - scan-build: |
+ cd seatd
+ ninja -C build scan-build
+ [ -z "$(ls -A build/meson-logs/scanbuild/ 2>/dev/null)" ]
+ - smoketest: |
+ cd seatd
+ rm -rf build
+ meson -Db_sanitize=address -Dlogind=enabled -Dseatd=enabled -Dbuiltin=enabled build
+ ninja -C build
+ timeout -s KILL 30s ./.builds/smoketest-seatd.sh
+ - smoketest-builtin: |
+ cd seatd
+ timeout -s KILL 30s ./.builds/smoketest-builtin.sh
diff --git a/.builds/smoketest-builtin.sh b/.builds/smoketest-builtin.sh
new file mode 100755
index 0000000..acf4640
--- /dev/null
+++ b/.builds/smoketest-builtin.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+res=0
+#
+# Run simpletest a few times
+#
+cnt=0
+while [ "$cnt" -lt 5 ]
+do
+ echo "Simpletest run $cnt"
+ if ! sudo LIBSEAT_BACKEND=builtin LIBSEAT_LOGLEVEL=debug SEATD_SOCK=./seatd.sock ./build/simpletest
+ then
+ echo "Simpletest failed"
+ res=1
+ break
+ fi
+ cnt=$((cnt+1))
+done
+
+
+exit $res
diff --git a/.builds/smoketest-seatd.sh b/.builds/smoketest-seatd.sh
new file mode 100755
index 0000000..ec97a1f
--- /dev/null
+++ b/.builds/smoketest-seatd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+#
+# Start seatd
+#
+[ -f seatd.sock ] && sudo rm seatd.sock
+sudo LIBSEAT_LOGLEVEL=debug SEATD_SOCK=./seatd.sock ./build/seatd &
+
+# seatd is started in the background, so wait for it to come alive
+cnt=0
+while ! [ -e ./seatd.sock ] && [ "$cnt" -lt 10 ]
+do
+ sleep 0.1
+ cnt=$((cnt+1))
+done
+
+if ! [ -e ./seatd.sock ]
+then
+ echo "seatd socket not found"
+ exit 1
+fi
+
+sudo chmod 777 ./seatd.sock
+
+#
+# Run simpletest a few times
+#
+cnt=0
+while [ "$cnt" -lt 5 ]
+do
+ echo "Simpletest run $cnt"
+ if ! LIBSEAT_LOGLEVEL=debug SEATD_SOCK=./seatd.sock ./build/simpletest
+ then
+ echo "Simpletest failed"
+ sudo killall seatd
+ exit 1
+ fi
+ cnt=$((cnt+1))
+done
+
+#
+# Wait for it to shut down
+#
+sudo killall seatd 2>/dev/null