File tree Expand file tree Collapse file tree 13 files changed +8941
-99
lines changed Expand file tree Collapse file tree 13 files changed +8941
-99
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- pip install eth-brownie
3
+ # Install eth-brownie if it's not already present
4
+ if [[ -z " $( command -v brownie) " ]]
5
+ then pip install eth-brownie
6
+ fi
7
+
4
8
brownie bake token
5
- cd token || exit 255
6
9
7
- crytic-compile . --compile-force-framework Brownie
10
+ cd token || exit 255
8
11
9
- if [ $? -ne 0 ]
10
- then
11
- echo " Brownie test failed"
12
- exit 255
12
+ if ! crytic-compile . --compile-force-framework Brownie
13
+ then echo " Brownie test failed" && exit 255
14
+ else echo " Brownie test passed" && exit 0
13
15
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test buidler integration
3
+ # Test buidler integration
4
4
5
5
cd tests/buidler || exit 255
6
6
7
- npm install --save-dev @nomiclabs/buidler
7
+ npm install || exit 255
8
8
9
- crytic-compile .
10
- if [ $? -ne 0 ]
11
- then
12
- echo " buidler test failed"
13
- exit 255
9
+ if ! crytic-compile .
10
+ then echo " Buidler test failed" && exit 255
11
+ else echo " Buidler test passed" && exit 0
14
12
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test dapp integration
3
+ # Test dapp integration
4
4
5
5
DIR=$( mktemp -d)
6
6
cd " $DIR " || exit 255
@@ -16,10 +16,7 @@ nix-env -f "$HOME/.dapp/dapptools" -iA dapp seth solc hevm ethsign
16
16
17
17
dapp init
18
18
19
- crytic-compile . --compile-remove-metadata
20
- if [ $? -ne 0 ]
21
- then
22
- echo " dapp test failed"
23
- exit 255
19
+ if ! crytic-compile . --compile-remove-metadata
20
+ then echo " dapp test failed" && exit 255
21
+ else echo " dapp test passed" && exit 0
24
22
fi
25
-
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test embark integration
3
+ # Test embark integration
4
4
5
5
cd /tmp || exit 255
6
6
13
13
embark demo
14
14
cd /tmp/embark_demo || exit 255
15
15
npm install
16
- crytic-compile . --embark-overwrite-config --compile-remove-metadata
17
16
18
- if [ $? -ne 0 ]
19
- then
20
- echo " Embark test failed"
21
- exit 255
17
+ if ! crytic-compile . --embark-overwrite-config --compile-remove-metadata
18
+ then echo " Embark test failed" && exit 255
19
+ else echo " Embark test passed" && exit 0
22
20
fi
23
-
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test etherlime integration
3
+ # Test etherlime integration
4
4
5
5
DIR=$( mktemp -d)
6
6
cd " $DIR " || exit 255
7
7
8
- npm i -g etherlime
8
+ # Install etherlime if it's not already present
9
+ if [[ -z " $( command -v etherlime) " ]]
10
+ then npm i -g etherlime
11
+ fi
12
+
9
13
etherlime init
10
- crytic-compile . --compile-remove-metadata
11
14
12
- if [ $? -ne 0 ]
13
- then
14
- echo " Etherlime test failed"
15
- exit 255
15
+ if ! crytic-compile . --compile-remove-metadata
16
+ then echo " Etherlime test failed" && exit 255
17
+ else echo " Etherlime test passed" && exit 0
16
18
fi
17
-
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test etherscan integration
3
+ # Test etherscan integration
4
4
5
5
DIR=$( mktemp -d)
6
6
cd " $DIR " || exit 255
7
7
8
8
solc-select use 0.4.25 --always-install
9
9
10
- crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
11
-
12
- if [ $? -ne 0 ]
13
- then
14
- echo " Etherscan test failed"
15
- exit 255
10
+ if ! crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
11
+ then echo " Etherscan test failed" && exit 255
16
12
fi
17
13
18
- crytic-compile rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
19
14
20
- if [ $? -ne 0 ]
21
- then
22
- echo " Etherscan test failed"
23
- exit 255
15
+ if ! crytic-compile rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
16
+ then echo " Etherscan test failed" && exit 255
24
17
fi
25
18
26
19
# From crytic/slither#1154
27
- crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
28
-
29
- if [ $? -ne 0 ]
30
- then
31
- echo " Etherscan test failed"
32
- exit 255
20
+ if ! crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
21
+ then echo " Etherscan test failed" && exit 255
33
22
fi
23
+
24
+ echo " Etherscan test passed" && exit 0
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # ## Test foundry integration
3
+ # Test foundry integration
4
4
5
-
6
- cd /tmp || exit 255
7
-
8
- curl -L https://foundry.paradigm.xyz | bash
9
- export PATH=$PATH :/home/runner/.foundry/bin
10
- foundryup
5
+ # Setup temp environment
6
+ DIR=$( mktemp -d)
7
+ cd " $DIR " || exit 255
11
8
12
9
# The foundry init process makes a temporary local git repo and needs certain values to be set
13
10
git config --global user.email
" [email protected] "
14
11
git config --global user.name " CI User"
15
12
16
- mkdir forge_test
17
- cd forge_test || exit 255
13
+ # Install foundry if it's not already present
14
+ if [[ -z " $( command -v foundryup) " ]]
15
+ then
16
+ curl -L https://foundry.paradigm.xyz | bash
17
+ export PATH=$PATH :/home/runner/.foundry/bin
18
+ fi
19
+
20
+ foundryup
18
21
forge init
19
22
20
- crytic-compile .
21
- if [ $? -ne 0 ]
22
- then
23
- echo " foundry test failed"
24
- exit 255
23
+ if ! crytic-compile .
24
+ then echo " Foundry test failed" && exit 255
25
+ else echo " Foundry test passed" && exit 0
25
26
fi
Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ cd tests/hardhat || exit 255
6
6
7
7
npm install
8
8
9
- crytic-compile .
10
- if [ $? -ne 0 ]
11
- then
12
- echo " hardhat test failed"
13
- exit 255
9
+ if ! crytic-compile .
10
+ then echo " Hardhat test failed" && exit 255
11
+ else echo " Hardhat test passed" && exit 0
14
12
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
DIR=$( mktemp -d)
4
-
5
4
cp tests/contract.sol " $DIR "
6
5
cd " $DIR " || exit 255
6
+
7
7
crytic-compile contract.sol --compile-remove-metadata --export-format truffle
8
8
9
9
cd - || exit 255
10
10
DIFF=$( diff " $DIR /crytic-export/C.json" tests/expected/solc-demo.json)
11
11
if [ " $? " != " 0" ] || [ " $DIFF " != " " ]
12
- then
13
- echo " solc test failed"
14
- echo " $DIFF "
15
- exit 255
12
+ then echo -e " solc test failed\n$DIFF " && exit 255
13
+ else echo -e " solc test passed" && exit 0
16
14
fi
17
-
18
-
Original file line number Diff line number Diff line change 5
5
DIR=$( mktemp -d)
6
6
cd " $DIR " || exit 255
7
7
8
- npm install -g truffle
8
+ # Install truffle if it's not already present
9
+ if [[ -z " $( command -v truffle) " ]]
10
+ then npm install -g truffle
11
+ fi
12
+
9
13
truffle unbox metacoin
10
- crytic-compile . --compile-remove-metadata
11
14
12
- if [ $? -ne 0 ]
13
- then
14
- echo " Truffle test failed"
15
- exit 255
15
+ if ! crytic-compile . --compile-remove-metadata
16
+ then echo " Truffle test failed" && exit 255
17
+ else echo " Truffle test passed" && exit 0
16
18
fi
19
+
17
20
# TODO: for some reason truffle output is not deterministc
18
21
# The assigned id changes
19
22
# cd -
You can’t perform that action at this time.
0 commit comments