-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcheck.sh
executable file
·46 lines (35 loc) · 1.03 KB
/
check.sh
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
#!/usr/bin/env nix-shell
#!nix-shell -i bash ./default.nix -I nixpkgs=channel:nixos-unstable-small
set -eux
#export LANG=en_US.UTF-8
#export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
function nixpkgs_rev() (
curl https://channels.nix.gsc.io/nixos-unstable-small/latest | cut -d' ' -f1
)
function main() {
export SUBSET="$1"
export REPORT_NAME="$2"
export REV=$(nixpkgs_rev)
export HASH=$(nix-prefetch-url --unpack "https://github.com/NixOS/nixpkgs/archive/${REV}.tar.gz")
export RUST_BACKTRACE=1
(
unset RUST_LOG
cargo build
)
cargo run -- \
--subset "$SUBSET" \
--rev "$REV" \
--sha256 "$HASH" \
--max-cores 48 \
--max-cores-per-job 4 \
check
cargo run -- \
--subset "$SUBSET" \
--rev "$REV" \
--sha256 "$HASH" \
report
mv ./report "./$REPORT_NAME"
tar -cJf "./$REPORT_NAME.tar.xz" "./$REPORT_NAME"
buildkite-agent artifact upload "./$REPORT_NAME.tar.xz"
}
main "$1" "$2"