Skip to content

Commit

Permalink
semgrep: try to fix CI timeout (ethereum-optimism#11798)
Browse files Browse the repository at this point in the history
  • Loading branch information
protolambda authored Sep 7, 2024
1 parent 747c9e7 commit 4fbe14f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,6 @@ jobs:
SEMGREP_REPO_URL: << pipeline.project.git_url >>
SEMGREP_BRANCH: << pipeline.git.branch >>
SEMGREP_COMMIT: << pipeline.git.revision >>

# Change job timeout (default is 1800 seconds; set to 0 to disable)
SEMGREP_TIMEOUT: 3000

docker:
- image: returntocorp/semgrep
resource_class: medium
Expand All @@ -1349,7 +1345,15 @@ jobs:
echo 'export SEMGREP_REPO_NAME=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
- run:
name: "Semgrep scan"
command: semgrep ci
# --time shows which rules take the most time
# --max-memory (in MiB) limits memory usage
# (defaults to 5GB, but medium runner only has 4GB, so we conservatively limit it to 3GB)
# --timeout (in seconds) limits the time per rule and file.
# SEMGREP_TIMEOUT is the same, but docs have conflicting defaults (5s in CLI flag, 1800 in some places)
# https://semgrep.dev/docs/troubleshooting/semgrep-app#if-the-job-is-aborted-due-to-taking-too-long
command: semgrep ci --time --timeout=100 --max-memory=3000
# If semgrep hangs, stop the scan after 20m, to prevent a useless 5h job
no_output_timeout: 20m
- notify-failures-on-develop

go-mod-download:
Expand Down

0 comments on commit 4fbe14f

Please sign in to comment.