Merge pull request #381 from crytic/github-actions

GitHub Actions
pull/385/head
Feist Josselin 5 years ago committed by GitHub
commit 0441338e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      .github/workflows/ci.yml
  2. 14
      README.md
  3. 5
      scripts/travis_test_dapp.sh

@ -0,0 +1,42 @@
name: CI
on:
push:
branches:
- master
- dev
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
type: ["4", "5", "cli", "dapp", "data_dependency", "embark", "erc", "etherlime", "etherscan", "find_paths", "kspec", "printers", "simil", "slither_config", "truffle", "upgradability"]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install dependencies
run: |
pip install .
# Used by travis_test.sh
pip install deepdiff
sudo wget -O /usr/bin/solc-0.4.25 https://github.com/ethereum/solidity/releases/download/v0.4.25/solc-static-linux
sudo chmod +x /usr/bin/solc-0.4.25
sudo wget -O /usr/bin/solc-0.5.1 https://github.com/ethereum/solidity/releases/download/v0.5.1/solc-static-linux
sudo chmod +x /usr/bin/solc-0.5.1
sudo wget -O /usr/bin/solc-0.5.0 https://github.com/ethereum/solidity/releases/download/v0.5.0/solc-static-linux
sudo chmod +x /usr/bin/solc-0.5.0
sudo cp /usr/bin/solc-0.5.1 /usr/bin/solc
- name: Run Tests
env:
TEST_TYPE: ${{ matrix.type }}
run: |
bash scripts/travis_test_${TEST_TYPE}.sh

@ -1,7 +1,7 @@
# Slither, the Solidity source analyzer # Slither, the Solidity source analyzer
<img src="./logo.png" alt="Logo" width="500"/> <img src="./logo.png" alt="Logo" width="500"/>
[![Build Status](https://travis-ci.com/crytic/slither.svg?token=JEF97dFy1QsDCfQ2Wusd&branch=master)](https://travis-ci.com/crytic/slither) [![Build Status](https://img.shields.io/github/workflow/status/crytic/slither/CI/master)](https://github.com/crytic/slither/actions)
[![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com) [![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com)
[![PyPI version](https://badge.fury.io/py/slither-analyzer.svg)](https://badge.fury.io/py/slither-analyzer) [![PyPI version](https://badge.fury.io/py/slither-analyzer.svg)](https://badge.fury.io/py/slither-analyzer)
@ -28,11 +28,11 @@ slither .
``` ```
Run Slither on a single file: Run Slither on a single file:
``` ```
$ slither tests/uninitialized.sol $ slither tests/uninitialized.sol
``` ```
For additional configuration, see the [usage](https://github.com/trailofbits/slither/wiki/Usage) documentation. For additional configuration, see the [usage](https://github.com/trailofbits/slither/wiki/Usage) documentation.
Use [solc-select](https://github.com/crytic/solc-select) if your contracts require older versions of solc. Use [solc-select](https://github.com/crytic/solc-select) if your contracts require older versions of solc.
@ -80,7 +80,7 @@ See the [Tool documentation](https://github.com/crytic/slither/wiki/Tool-Documen
## How to install ## How to install
Slither requires Python 3.6+ and [solc](https://github.com/ethereum/solidity/), the Solidity compiler. Slither requires Python 3.6+ and [solc](https://github.com/ethereum/solidity/), the Solidity compiler.
### Using Pip ### Using Pip
@ -99,7 +99,7 @@ We recommend using an Python virtual environment, as detailed in the [Developer
### Using Docker ### Using Docker
Use the [`eth-security-toolbox`](https://github.com/trailofbits/eth-security-toolbox/) docker image. It includes all of our security tools and every major version of Solidity in a single image. `/home/share` will be mounted to `/share` in the container. Use the [`eth-security-toolbox`](https://github.com/trailofbits/eth-security-toolbox/) docker image. It includes all of our security tools and every major version of Solidity in a single image. `/home/share` will be mounted to `/share` in the container.
``` ```
docker pull trailofbits/eth-security-toolbox docker pull trailofbits/eth-security-toolbox

@ -4,6 +4,9 @@
mkdir test_dapp mkdir test_dapp
cd test_dapp cd test_dapp
# 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"
curl https://nixos.org/nix/install | sh curl https://nixos.org/nix/install | sh
. "$HOME/.nix-profile/etc/profile.d/nix.sh" . "$HOME/.nix-profile/etc/profile.d/nix.sh"
@ -18,7 +21,7 @@ dapp init
slither . slither .
if [ $? -eq 22 ] if [ $? -eq 22 ]
then then
exit 0 exit 0
fi fi

Loading…
Cancel
Save