-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile.toml
168 lines (140 loc) · 3.02 KB
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
[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.demo]
command = "cargo"
args = [
"run",
"--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",
]
# Eyeball (manual QA) tasks
[tasks.demo-build]
command = "cargo"
args = [
"build",
"--example",
"demo",
"--features", "crossterm",
]
[tasks.eyeball]
script = '''
cargo make eyeball-xterm &
cargo make eyeball-foot &
cargo make eyeball-kitty &
cargo make eyeball-wezterm &
'''
[tasks.eyeball-xterm]
dependencies = [ "demo-build" ]
command = "xterm"
args = [ "-ti", "vt340", "./target/debug/examples/demo" ]
[tasks.eyeball-foot]
dependencies = [ "demo-build" ]
command = "foot"
args = [ "./target/debug/examples/demo" ]
[tasks.eyeball-wezterm]
dependencies = [ "demo-build" ]
script = '''
PWD=$(pwd)
wezterm start --cwd $PWD ./target/debug/examples/demo
'''
[tasks.eyeball-kitty]
dependencies = [ "demo-build" ]
command = "kitty"
args = [ "./target/debug/examples/demo" ]