[env] SCREENSHOT_TERM = "xterm -ti vt340 -fa DejaVu -fs 7 -bg black -fg white" SCREENSHOT_TERM_NAME = "xterm" BACKEND = "crossterm" [env.termion] BACKEND = "termion" [env.termwiz] BACKEND = "termwiz" [tasks.default] alias = "ci" [tasks.ci-all] script = ''' cargo make ci cargo make --profile termion ci cargo make --profile termwiz ci ''' [tasks.ci-windows] script = ''' cargo make ci cargo make --profile termwiz ci ''' [tasks.ci] dependencies = [ "fmt", "clippy", "check", "test", "readme", "build", ] [tasks.fmt] command = "cargo" args = ["fmt", "--all", "--", "--check"] [tasks.clippy] command = "cargo" args = ["clippy", "--no-deps", "--tests", "--all-features", "--", "-D", "warnings"] [tasks.check] command = "cargo" args = ["check", "--all-features"] [tasks.test] command = "cargo" args = ["test", "--features", "${BACKEND}"] [tasks.readme] command = "cargo" args = ["readme", "-o", "README.md"] [tasks.build] command = "cargo" args = ["build", "--features", "${BACKEND}"] [tasks.run-example] command = "cargo" args = [ "run", "--release", "--example", "demo", "--features", "serde,crossterm", ] # Screenshot tests [tasks.screenshot-build] command = "cargo" args = [ "build", "--example", "screenshot", "--features", "crossterm", ] [tasks.screenshot-xvfb] dependencies = [ "screenshot-build", ] script = ''' echo ${SCREENSHOT_TERM} ${PWD}/target/debug/examples/screenshot xvfb-run -s "-screen 0 640x480x24" ${SCREENSHOT_TERM} ${PWD}/target/debug/examples/screenshot ''' [tasks.screenshot-diff] command = "dify" args = [ "-t", "0.15", "assets/screenshot_${SCREENSHOT_TERM_NAME}.png", "target/screenshot_${SCREENSHOT_TERM_NAME}.png", "-o", "target/diff_${SCREENSHOT_TERM_NAME}.png", ] [tasks.screenshot-ci] dependencies = [ "screenshot-xvfb", "screenshot-diff", ] [tasks.screenshot-update] script = ''' cp target/screenshot_${SCREENSHOT_TERM_NAME}.png assets/screenshot_${SCREENSHOT_TERM_NAME}.png ''' [tasks.screenshot-record] dependencies = [ "demo-build", ] command = "menyoki" args = [ "--quiet", "record", # "--countdown", "1", # "--size", "200x300", # does not work with xmonad # "--font", "-*-dejavu sans-*-*-*-*-7-*-*-*-*-*-*-*", # has no effect with xmonad "./target/debug/examples/demo", "gif", "save", "target/recording.gif", ]