Skip to content

Commit

Permalink
add missing step id to action (smartcontractkit#14088)
Browse files Browse the repository at this point in the history
* add missing step id

* do not fail if Slither fails

* try with not failing generation
  • Loading branch information
Tofel authored Aug 9, 2024
1 parent 288257a commit 349778b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/solidity-foundry-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
fetch-depth: 0

- name: Extract Foundry version
id: extract-foundry-version
uses: ./.github/actions/detect-solidity-foundry-version
with:
working-directory: contracts
Expand Down
14 changes: 6 additions & 8 deletions contracts/scripts/ci/generate_slither_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ run_slither() {
>&2 echo "::error::Failed to select Solc version for $FILE"
return 1
fi
set -e

SLITHER_OUTPUT_FILE="$TARGET_DIR/$(basename "${FILE%.sol}")-slither-report.md"

output=$(slither --config-file "$CONFIG_FILE" "$FILE" --checklist --markdown-root "$REPO_URL" --fail-none $SLITHER_EXTRA_PARAMS)
if [ $? -ne 0 ]; then
>&2 echo "::error::Slither failed for $FILE"
exit 1
if ! output=$(slither --config-file "$CONFIG_FILE" "$FILE" --checklist --markdown-root "$REPO_URL" --fail-none $SLITHER_EXTRA_PARAMS); then
>&2 echo "::warning::Slither failed for $FILE"
return 0
fi
set -e
output=$(echo "$output" | sed '/\*\*THIS CHECKLIST IS NOT COMPLETE\*\*. Use `--show-ignored-findings` to show all the results./d' | sed '/Summary/d')

echo "# Summary for $FILE" > "$SLITHER_OUTPUT_FILE"
Expand Down Expand Up @@ -80,8 +78,8 @@ set +e
process_files "$SOURCE_DIR" "$TARGET_DIR" "${FILES[@]}"

if [[ $? -ne 0 ]]; then
>&2 echo "::error::Failed to generate Slither reports"
exit 1
>&2 echo "::warning::Failed to generate some Slither reports"
exit 0
fi

echo "Slither reports saved in $TARGET_DIR folder"
2 changes: 1 addition & 1 deletion contracts/scripts/ci/generate_uml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ process_selected_files() {
MATCHES=($(find "$SOURCE_DIR" -type f -path "*/$FILE"))

if [[ ${#MATCHES[@]} -gt 1 ]]; then
>&2 echo "Error: Multiple matches found for $FILE:"
>&2 echo "::error:: Multiple matches found for $FILE:"
for MATCH in "${MATCHES[@]}"; do
>&2 echo " $MATCH"
done
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/ci/select_solc_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ set +e
SOLCVER=$(extract_pragma "$FILE")

if [[ $? -ne 0 ]]; then
echo "Error: Failed to extract the Solidity version from $FILE."
>&2 echo "::error:: Failed to extract the Solidity version from $FILE."
return 1
fi

Expand Down

0 comments on commit 349778b

Please sign in to comment.