From 8d3aa94450a9c1bb675e570634cd4628ddaa1533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 5 Jan 2023 10:31:30 -0300 Subject: [PATCH 1/4] ci: etherscan: add output grouping --- scripts/ci_test_etherscan.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ci_test_etherscan.sh b/scripts/ci_test_etherscan.sh index c8e69958cb..77457dc433 100755 --- a/scripts/ci_test_etherscan.sh +++ b/scripts/ci_test_etherscan.sh @@ -5,15 +5,19 @@ mkdir etherscan cd etherscan || exit 255 +echo "::group::Etherscan mainnet" if ! slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --etherscan-apikey "$GITHUB_ETHERSCAN"; then - echo "Etherscan test failed" + echo "Etherscan mainnet test failed" exit 1 fi +echo "::endgroup::" +echo "::group::Etherscan rinkeby" if ! slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --etherscan-apikey "$GITHUB_ETHERSCAN"; then - echo "Etherscan test failed" + echo "Etherscan rinkeby test failed" exit 1 fi +echo "::endgroup::" exit 0 From d72302f94c033c5d2739af71672d467796b8807f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 5 Jan 2023 10:31:49 -0300 Subject: [PATCH 2/4] ci: etherscan: sleep briefly when the API key is not available Etherscan performs a 1/5s rate limit when using no API key, so this adds a small random sleep to avoid the second test failing if it executes fast enough. --- scripts/ci_test_etherscan.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/ci_test_etherscan.sh b/scripts/ci_test_etherscan.sh index 77457dc433..2f17d3f5dc 100755 --- a/scripts/ci_test_etherscan.sh +++ b/scripts/ci_test_etherscan.sh @@ -12,6 +12,11 @@ if ! slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --etherscan-apikey "$GIT fi echo "::endgroup::" +# Perform a small sleep when API key is not available (e.g. on PR CI from external contributor) +if [ "$GITHUB_ETHERSCAN" = "" ]; then + sleep $(( ( RANDOM % 5 ) + 1 ))s +fi + echo "::group::Etherscan rinkeby" if ! slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --etherscan-apikey "$GITHUB_ETHERSCAN"; then echo "Etherscan rinkeby test failed" From 2109b5fad980b98315348bf4f47c01e2077e5b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 5 Jan 2023 11:11:07 -0300 Subject: [PATCH 3/4] ci: etherscan: fix test check --- scripts/ci_test_etherscan.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci_test_etherscan.sh b/scripts/ci_test_etherscan.sh index 2f17d3f5dc..6946906919 100755 --- a/scripts/ci_test_etherscan.sh +++ b/scripts/ci_test_etherscan.sh @@ -6,7 +6,7 @@ mkdir etherscan cd etherscan || exit 255 echo "::group::Etherscan mainnet" -if ! slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --etherscan-apikey "$GITHUB_ETHERSCAN"; then +if ! slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --etherscan-apikey "$GITHUB_ETHERSCAN" --no-fail-pedantic; then echo "Etherscan mainnet test failed" exit 1 fi @@ -18,7 +18,7 @@ if [ "$GITHUB_ETHERSCAN" = "" ]; then fi echo "::group::Etherscan rinkeby" -if ! slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --etherscan-apikey "$GITHUB_ETHERSCAN"; then +if ! slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --etherscan-apikey "$GITHUB_ETHERSCAN" --no-fail-pedantic; then echo "Etherscan rinkeby test failed" exit 1 fi From ac624bfcefb52468ff05b1e114a5b47057108559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 5 Jan 2023 11:09:45 -0300 Subject: [PATCH 4/4] ci: etherscan: re-enable test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ae5326a82..6503d2b627 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: # "embark", "erc", # "etherlime", - # "etherscan" + "etherscan", "find_paths", "flat", "kspec",