forked from deepcausality-rs/deep_causality
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_deps.sh
executable file
·156 lines (125 loc) · 4.39 KB
/
install_deps.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
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
# SPDX-License-Identifier: MIT
# Copyright (c) "2023" The DeepCausality Authors. All Rights Reserved.
# bin/bash
set -o errexit
set -o nounset
set -o pipefail
# "---------------------------------------------------------"
# "- -"
# "- Tests all dependencies required by make -"
# "- -"
# "---------------------------------------------------------"
command bash --version >/dev/null 2>&1 || {
# command sudo apt-get -qqq -y install curl
echo "Please install bash"
exit
}
echo "* Bash installed"
command curl --version >/dev/null 2>&1 || {
# command sudo apt-get -qqq -y install curl
echo "curl is used to download Rust & Cargo"
echo "Please install curl"
exit
}
echo "* Curl installed"
command rustc --version >/dev/null 2>&1 || {
echo "Trying to install Rust & Cargo"
command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
command rustc --version >/dev/null 2>&1 || {
echo "Please install Rust & Cargo"
echo "https://www.rust-lang.org/tools/install"
echo "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
exit
}
echo "* Rust & Cargo installed"
# Try to install nightly if its missing
command rustc +nightly --version >/dev/null 2>&1 || {
echo "Trying to install nightly Rust "
command rustup toolchain install nightly
}
# Check again and if previous install failed, print guide for manual install
command rustc +nightly --version >/dev/null 2>&1 || {
echo "Please install nightly Rust "
echo "https://doc.rust-lang.org/book/appendix-07-nightly-rust.html"
echo "rustup toolchain install nightly"
exit
}
echo "* Rust nightly installed"
command cargo fmt --version >/dev/null 2>&1 || {
echo "Trying to install cargo fmt"
command rustup component add rustfmt
}
command cargo fmt --version >/dev/null 2>&1 || {
echo "Cargo fmt formats rust code"
echo "Please install cargo fmt"
echo "rustup component add rustfmt"
echo "https://github.com/rust-lang/rustfmt"
exit
}
echo "* cargo fmt installed"
command cargo nextest --version >/dev/null 2>&1 || {
echo "Trying to install cargo nextest"
command cargo install cargo-nextest --locked
}
command cargo nextest --version >/dev/null 2>&1 || {
echo "Cargo nextest runs tests im parallel"
echo "Please install Cargo nextest"
echo "cargo install cargo-nextest --locked"
echo "https://nexte.st/book/installing-from-source.html"
exit
}
echo "* cargo nextest installed"
command cargo outdated --version >/dev/null 2>&1 || {
echo "Trying to install Cargo outdated"
command cargo install --locked cargo-outdated
}
command cargo outdated --version >/dev/null 2>&1 || {
echo "Cargo outdated tests for outdated dependencies"
echo "Please install Cargo outdated"
echo "cargo install --locked cargo-outdated"
echo "https://github.com/kbknapp/cargo-outdated"
exit
}
echo "* cargo outdated installed"
command cargo +nightly udeps --version >/dev/null 2>&1 || {
echo "Trying to install Cargo udeps"
command cargo install cargo-udeps --locked
}
command cargo +nightly udeps --version >/dev/null 2>&1 || {
echo "Cargo udeps tests for unused dependencies"
echo "Please install Cargo udeps"
echo "cargo install cargo-udeps --locked"
echo "https://crates.io/crates/cargo-udeps"
exit
}
echo "* cargo udeps installed"
command cargo audit --version >/dev/null 2>&1 || {
echo "Trying to install Cargo audit"
command cargo install cargo-audit
}
command cargo audit --version >/dev/null 2>&1 || {
echo "Cargo audit tests and reports security vulnerabilities"
echo "Please install Cargo audit"
echo "cargo install cargo-audit"
echo "https://crates.io/crates/cargo-audit"
exit
}
echo "* cargo audit installed"
command cargo clippy --version >/dev/null 2>&1 || {
echo "Trying to install Cargo clippy"
command rustup component add clippy
}
command cargo clippy --version >/dev/null 2>&1 || {
echo "Cargo clippy checks for linting errors"
echo "Please install Cargo clippy"
echo "rustup component add clippy"
echo "https://github.com/rust-lang/rust-clippy"
exit
}
echo "* cargo clippy installed"
echo ""
echo "==============================="
echo "All DEV dependencies installed."
echo "==============================="
echo ""