-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnlyfile
More file actions
100 lines (80 loc) · 2.34 KB
/
Copy pathOnlyfile
File metadata and controls
100 lines (80 loc) · 2.34 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
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
!version 0.4
!var cargo_flags = "--all-targets"
!var pnpm_dir = "web"
!var dist_dir = "dist"
# Example workflow for a Rust backend and web frontend.
[help] Run all checks.
ci() & (front.ci, back.ci):
echo "CI complete"
[help] Package a verified release.
release() & ci & package:
echo "Release ready in {{dist_dir}}"
[help] Package Windows artifacts.
package()
? @os("windows")
& (front.build, back.build)
shell~=pwsh
:
| $archive = "{{dist_dir}}/app.zip"
| New-Item -ItemType Directory -Force -Path {{dist_dir}} | Out-Null
| Compress-Archive -Path target/release/app.exe, {{pnpm_dir}}/dist -DestinationPath $archive -Force
| Write-Output "Created $archive"
# macOS/Linux fallback.
[help] Package Unix artifacts.
package() & (front.build, back.build):
| archive="{{dist_dir}}/app.tar.gz"
| mkdir -p {{dist_dir}}
| tar -czf "$archive" target/release/app {{pnpm_dir}}/dist
| echo "Created $archive"
[help] Frontend tasks.
group front {
_prepare() ? @has("pnpm"):
pnpm --dir {{pnpm_dir}} install --frozen-lockfile
_prepare():
echo "pnpm is required"
exit 1
[help] Start the dev server.
dev(port = "5173") & _prepare:
pnpm --dir {{pnpm_dir}} dev -- --port {{port}}
[help] Check the frontend.
check() & _prepare:
pnpm --dir {{pnpm_dir}} lint
[help] Test the frontend.
test() & _prepare:
pnpm --dir {{pnpm_dir}} test
[help] Build the frontend.
build() & _prepare:
pnpm --dir {{pnpm_dir}} build
[help] Run frontend checks.
ci() & (check, test):
echo "Frontend CI complete"
}
[help] Backend tasks.
group back {
[help] Format the Rust workspace.
fmt():
cargo fmt --all -- --check
[help] Run Cargo check.
check():
cargo check {{cargo_flags}}
[help] Run Clippy.
clippy():
cargo clippy {{cargo_flags}} -- -D warnings
[help] Run CI tests with nextest when available.
test() ? @env("CI") ? @has("cargo-nextest"):
cargo nextest run {{cargo_flags}} --no-fail-fast
[help] Run CI tests.
test():
cargo test {{cargo_flags}}
[help] Build the release binary.
build():
cargo build --release
[help] Run all backend checks.
ci()
& fmt
& check
& clippy
& test
:
echo "Backend CI complete"
}