-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.sh
More file actions
41 lines (31 loc) · 976 Bytes
/
Copy pathci.sh
File metadata and controls
41 lines (31 loc) · 976 Bytes
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
#!/bin/sh
set -e
root=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
workspaces="
$root/w8
$root/wdt
"
steps="
Check|cargo check --manifest-path {WS}/Cargo.toml
Format|cargo fmt --all --check --manifest-path {WS}/Cargo.toml
Clippy|cargo clippy --all-targets --all-features --manifest-path {WS}/Cargo.toml -- -D warnings
Build|cargo build --release --manifest-path {WS}/Cargo.toml
Test|cargo test --workspace --release --manifest-path {WS}/Cargo.toml
"
for ws in $workspaces; do
[ -z "$ws" ] && continue
while IFS='|' read -r name command; do
[ -z "$name" ] && continue
cmd=$(printf '%s' "$command" | sed "s|{WS}|$ws|g")
printf '======> [%s] %s\n' "$(basename "$ws")" "$name"
sh -c "$cmd" || {
status=$?
printf '[%s] %s failed with exit code %s\n' "$(basename "$ws")" "$name" "$status" >&2
exit "$status"
}
done <<EOF
$steps
EOF
done
printf '\n'
printf ' CI passed!\n'