-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
56 lines (49 loc) · 1.84 KB
/
justfile
File metadata and controls
56 lines (49 loc) · 1.84 KB
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
CI_OUTPUT := "ci-output"
# List available recipes
default:
@just --list
# Run the rust tests, restart on change
test:
git ls-files | entr -cr cargo test
# Run the server, restart on change
server:
git ls-files | entr -cr cargo run --bin server
# Open a live-reloading web view of the doc
book:
cd book && mdbook serve --open
# Build vscode extension at `editors/vscode/lsp-sample-1.0.0.vsix`
vscode-extension:
cd ./editors/vscode && vsce package --allow-star-activation --skip-license
# Debug a nixos test interactively
nixos-test-interactive:
nix build .#checks.x86_64-linux.simple.driverInteractive && ./result/bin/nixos-test-driver
# Runs all nix tests one by one
ci:
#!/usr/bin/env bash
set -e
rm -rf {{CI_OUTPUT}} && mkdir -p {{CI_OUTPUT}}
TESTS=$(nix flake show --all-systems --json | jq -r '.checks."x86_64-linux" | keys[]')
printf "{{BLUE}}Running tests: {{YELLOW}}[$(echo "$TESTS" | paste -sd, -)]{{NORMAL}}\n"
for test in $TESTS; do
printf "{{BLUE}}Running test {{YELLOW}}%s{{NORMAL}}\n" "$test"
if ! x=$(nix build -L .#checks.x86_64-linux.$test); then
echo "$test" >> {{CI_OUTPUT}}/failures
fi
if [ "$test" != "pre-commit-check" ]; then
if ! x=$(diff result/client*/test.md); then
echo "$test" >> {{CI_OUTPUT}}/failures
fi
printf "{{BLUE}}Concatenating videos of clients{{NORMAL}}\n"
find result/client* -name '*.mkv' |
sort |
xargs -I{} echo -i {} |
xargs ffmpeg -filter_complex vstack {{CI_OUTPUT}}/$test.mp4
fi
done
if [ -f {{CI_OUTPUT}}/failures ]; then
printf "{{RED}}{{BOLD}}SOME TESTS FAILED:{{NORMAL}}\n"
cat {{CI_OUTPUT}}/failures
exit 1
else
printf "{{GREEN}}{{BOLD}}ALL TESTS PASSED!{{NORMAL}}\n"
fi