From 8180d332c0e77e2ead4a4c4451688b4d1d00bf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Mon, 3 Jan 2022 05:37:26 -0300 Subject: [PATCH] Move echidna action to crytic/echidna-action (#701) This removes the action from the echidna repository. The action will now live on its own repository, where it can be versioned and published independently. Additionally, this updates the workflow to refer to the action on its new location, as well as adds a few lines to the README pointing to the new action location. --- .github/workflows/action.yml | 4 +-- README.md | 7 ++++ action/Dockerfile | 5 --- action/action.yml | 63 ------------------------------------ action/entrypoint.sh | 47 --------------------------- 5 files changed, 9 insertions(+), 117 deletions(-) delete mode 100644 action/Dockerfile delete mode 100644 action/action.yml delete mode 100644 action/entrypoint.sh diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 18361117..d41dc607 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2 - name: Assert test - uses: ./action + uses: crytic/echidna-action@v1 with: files: "examples/solidity/basic/assert.sol" contract: "TestAssert" @@ -26,7 +26,7 @@ jobs: negate-exit-status: 1 - name: Multi-abi test - uses: ./action + uses: crytic/echidna-action@v1 with: files: "examples/solidity/basic/multi-abi.sol" contract: "B" diff --git a/README.md b/README.md index ff3bb0d2..34722605 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,13 @@ subject to change to be slightly more user friendly at a later date. `testType` will either be `property` or `assertion`, and `status` always takes on either `fuzzing`, `shrinking`, `solved`, `passed`, or `error`. +### Using Echidna in a GitHub Actions workflow + +There is an Echidna action which can be used to run `echidna-test` as part of a +GitHub Actions workflow. Please refer to the +[crytic/echidna-action](https://github.com/crytic/echidna-action) repository for +usage instructions and examples. + ## Limitations and known issues EVM emulation and testing is hard. Echidna has a number of limitations in the latest release. Some of these are inherited from [hevm](https://github.com/dapphub/dapptools/tree/master/src/hevm) while some are results from design/performance decisions or simply bugs in our code. We list them here including their corresponding issue and the status ("wont fix", "in review", "fixed"). Issues that are "fixed" are expected to be included in the next Echidna release. diff --git a/action/Dockerfile b/action/Dockerfile deleted file mode 100644 index c2683abf..00000000 --- a/action/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM trailofbits/echidna -RUN pip3 install solc-select -COPY entrypoint.sh /entrypoint.sh -RUN chmod ugo+x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/action/action.yml b/action/action.yml deleted file mode 100644 index 4557bc64..00000000 --- a/action/action.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: "Echidna" - -description: "Run echidna-test" - -inputs: - files: - description: "Solidity files to analyze" - required: true - contract: - description: "Contract to analyze" - required: false - config: - description: "Config file (CLI arguments override config options)" - required: false - format: - description: "Output format: json, text, none. Disables interactive UI" - required: false - corpus-dir: - description: "Directory to store corpus and coverage data" - required: false - check-asserts: - description: "Check asserts in the code" - required: false - multi-abi: - description: "Use multi-abi mode of testing" - required: false - test-limit: - description: "Number of sequences of transactions to generate during testing" - required: false - shrink-limit: - description: "Number of tries to attempt to shrink a failing sequence of transactions" - required: false - seq-len: - description: "Number of transactions to generate during testing" - required: false - contract-addr: - description: "Address to deploy the contract to test" - required: false - deployer: - description: "Address of the deployer of the contract to test" - required: false - sender: - description: "Addresses to use for the transactions sent during testing" - required: false - seed: - description: "Run with a specific seed" - required: false - crytic-args: - description: "Additional arguments to use in crytic-compile for the compilation of the contract to test" - required: false - solc-args: - description: "Additional arguments to use in solc for the compilation of the contract to test" - required: false - solc-version: - description: "Version of the Solidity compiler to use" - required: false - negate-exit-status: - description: "Apply logical NOT to echidna-test's exit status (for testing the action)" - required: false - -runs: - using: "docker" - image: "Dockerfile" diff --git a/action/entrypoint.sh b/action/entrypoint.sh deleted file mode 100644 index e253f63f..00000000 --- a/action/entrypoint.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/bash - -set -eu - -export PYTHONPATH=/root/.local/lib/python3.6/site-packages - -OPTIONS="contract config format corpus-dir test-limit shrink-limit seq-len \ -contract-addr deployer sender seed crytic-args solc-args" - -SWITCHES="check-asserts multi-abi" - -# smoelius: `get` works for non-standard variable names like `INPUT_CORPUS-DIR`. -get() { - env | sed -n "s/^$1=\(.*\)/\1/;T;p" -} - -CMD=(echidna-test "$INPUT_FILES") - -for OPTION in $OPTIONS; do - NAME=INPUT_"${OPTION^^}" - VALUE="$(get "$NAME")" - if [[ -n "$VALUE" ]]; then - CMD+=(--"$OPTION" "$VALUE") - fi -done - -for SWITCH in $SWITCHES; do - NAME=INPUT_"${SWITCH^^}" - VALUE="$(get "$NAME")" - if [[ -n "$VALUE" ]]; then - CMD+=(--"$SWITCH") - fi -done - -SOLC_VERSION="$(get 'INPUT_SOLC-VERSION')" -if [[ -n "$SOLC_VERSION" ]]; then - solc-select install "$SOLC_VERSION" - solc-select use "$SOLC_VERSION" -fi - -echo "${CMD[@]}" >&2 - -if [[ -n "$(get 'INPUT_NEGATE-EXIT-STATUS')" ]]; then - ! "${CMD[@]}" -else - "${CMD[@]}" -fi