image: archlinux
packages:
   - meson
   - linux-headers
   - clang
   - clang-analyzer
   - scdoc
sources:
   - https://git.sr.ht/~kennylevinsen/seatd
tasks:
   - prepare: |
      meson setup -Db_sanitize=address -Dlibseat-logind=auto -Dlibseat-seatd=enabled -Dlibseat-builtin=enabled -Dexamples=enabled build seatd
   - build: |
      ninja -C build
      sudo ninja -C build install
   - unittest: |
      ninja -C build test
   - scan-build: |
      ninja -C build scan-build
      [ -z "$(ls -A build/meson-logs/scanbuild/ 2>/dev/null)" ]
   - smoketest: |
      timeout -s KILL 30s sudo ./build/seatd-launch -l debug -- ./build/simpletest /dev/input/event0
   - smoketest-builtin: |
      timeout -s KILL 30s sudo LIBSEAT_BACKEND=builtin ./build/simpletest /dev/input/event0
