Static Analyzer for Solidity
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
slither/scripts/ci_test_dapp.sh

29 lines
779 B

#!/usr/bin/env bash
### Test Dapp integration
# work around having two python versions loading libraries from each other in CI
OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
alias crytic-compile='LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH crytic-compile'
unset LD_LIBRARY_PATH
mkdir test_dapp
cd test_dapp || exit 255
5 years ago
# The dapp init process makes a temporary local git repo and needs certain values to be set
git config --global user.email "ci@trailofbits.com"
git config --global user.name "CI User"
Windows CI for Slither (#1137) * workflows: parser: use solc-select from pip The hardcoded, manually-installed version is out of date. This updates the workflow to install directly from pip now that it is available there. * workflows: parser: Run tests also on Windows * workflows: parser: bump solc-select to >=v1.0.0b1 This version introduces Windows support. * workflows: parser: FIXME: install patched crytic-compile * workflows: features: enable Windows runs This enables runs on windows-2022 and updates solc-select to support running on Windows. * workflows: features: FIXME: install patched crytic-compile * workflows: detectors: enable Windows runs This enables runs on windows-2022 and updates solc-select to support running on Windows. * workflows: detectors, features, parser: disable fail-fast Disable fail-fast so failures in one platform do not hide failures in the other OS. * tests: detectors: adjust GENERIC_PATH replacement for Windows Backslashes are escaped in the string representation, so we need to double them before replacing. Also change generic path to a constant string to avoid it being converted to "\GENERIC_PATH" in Windows and getting an invalid escape error from the JSON decoder later on. * tests: use lf endings for test code If autocrlf is enabled on Windows, it will rewrite solc code with CRLF file endings and break tests that depend on byte offsets in the code files. * workflows: detectors: FIXME: install patched crytic-compile * workflows: ci: enable Windows runs This enables runs on windows-2022 and updates solc-select to support running on Windows. Some tests with Linux requirements are excluded. * workflows: ci: FIXME: install patched crytic-compile * workflows: *: update actions/setup-python to v3 v1 does not install Python correctly on Windows. While at it, update all instances to v3. * workflows: ci: add msys2 tools to path * workflows: ci: disable broken Windows workflows * workflows: apply linter fixes * workflows: ci: enable dapp test * tests: dapp: fix test * core: normalize paths on POSIX style * workflows: ci: enable printers tests on Windows
3 years ago
which nix-env || exit 255
git clone --recursive https://github.com/dapphub/dapptools "$HOME/.dapp/dapptools"
nix-env -f "$HOME/.dapp/dapptools" -iA dapp seth solc hevm ethsign
dapp init
2 years ago
if ! slither . --detect external-function; then
echo "Dapp test failed"
exit 1
fi
exit 0