AtlatestRepositorysigil-ui

sigil-ui / tree / scriptscheck-linux.sgl

1#!/usr/bin/env sigil
2;;; Build and test on a Linux host with an installed runtime (argument one).
3(import (sigil shell prelude))
4(requires (tools env))
5(define root (realpath (path (script-dir) "..")))
6(define runtime (realpath (arg 1)))
7(setenv! "PATH" (str (dirname runtime) ":" (getenv "PATH")))
8(setenv! "SIGIL_JOBS" "2")
9(define evidence (path root "build" "linux-check"))
10(ensure-directory evidence)
11(define (step name argv directory)
12 (println "Starting ~a" name)
13 (flush-output-port (current-output-port))
14 (let ((result ($? ,@argv cwd: ,directory out: ,(path evidence (str name ".log"))
15 err: 'merge timeout: 900)))
16 (write-text (path evidence (str name ".result")) (format-outcome result))
17 (unless (ok? result) (error "Failed step; see evidence" name))))
18(step "deps" (list runtime "deps" "install") root)
19(step "build" (list runtime "build") root)
20(step "tests" (list runtime "test") root)
21(write-text (path root "demo" "dev-redirects.sgl")
22 "(redirects packages: (list (for-package name: \"sigil/sigil-ui\" use: (from-path dir: \"..\"))))\n")
23(setenv! "SIGIL_REDIRECTS" (path root "demo" "dev-redirects.sgl"))
24(step "demo-deps" (list runtime "deps" "install") (path root "demo"))
25(step "demo-build" (list runtime "build") (path root "demo"))
26(step "wayland-live"
27 (list (path root "test/wayland/run") (path root "test/wayland/live.sgl")
28 (path root "test/wayland/window-loop.sgl")) root)
29(println "PASS: Linux build, tests, demo and live Wayland")