-
Notifications
You must be signed in to change notification settings - Fork 268
/
bootstrap.sh
executable file
·63 lines (54 loc) · 1.14 KB
/
bootstrap.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
#!/usr/bin/env bash
source $(git rev-parse --show-toplevel)/ci3/source_bootstrap
cmd=${1:-}
export hash=$(cache_content_hash .rebuild_patterns)
function build {
github_group "l1-contracts build"
local artifact=l1-contracts-$hash.tar.gz
if ! cache_download $artifact; then
# Clean
rm -rf broadcast cache out serve
# Install
forge install --no-commit
# Ensure libraries are at the correct version
git submodule update --init --recursive ./lib
# Compile contracts
forge build
cache_upload $artifact out
fi
github_endgroup
}
function test {
set -eu
local test_flag=l1-contracts-test-$hash
if test_should_run $test_flag; then
github_group "l1-contracts test"
solhint --config ./.solhint.json "src/**/*.sol"
forge fmt --check
forge test --no-match-contract UniswapPortalTest
cache_upload_flag $test_flag
github_endgroup
fi
}
export -f test
case "$cmd" in
"clean")
git clean -fdx
;;
""|"fast"|"full")
build
;;
"test")
test
;;
"ci")
build
denoise test
;;
"hash")
echo $hash
;;
*)
echo "Unknown command: $cmd"
exit 1
esac