Skip to content

Commit

Permalink
Merge branch 'master' into cfn-lint-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-deepsource authored Feb 5, 2024
2 parents 945e413 + 0c203c5 commit e15aed3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions analyzers/slither/CI/gitlab-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
stages:
- scan_and_report

before_script:
- apt update
# install slither
- python -m pip install --upgrade pip
- pip3 install slither-analyzer

scan_and_report:
stage: scan_and_report
image: nikolaik/python-nodejs:latest # requires an image with python and nodejs

script:
# Run Slither
# make sure to modify the solidity compiler version
- export SOLC_VERSION=0.4.15
- solc-select install $SOLC_VERSION
# make sure to modify the path to your contracts
- slither . --sarif slither.sarif --fail-none
# Install the DeepSource CLI and send the report to DeepSource
# Make sure you set the `DEEPSOURCE_DSN` env variable as a secret in your project.
- curl https://deepsource.io/cli | sh
- ./bin/deepsource report --analyzer slither --analyzer-type community --value-file slither.sarif

rules:
- if: $CI_PIPELINE_SOURCE == "push"
23 changes: 23 additions & 0 deletions analyzers/solhint/CI/gitlab-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
stages:
- scan_and_report

before_script:
- apt update
# install Solhint
- npm install solhint@^4.1.1 # version installed should be greater than 4.1.1

scan_and_report:
stage: scan_and_report
image: node:latest # requires an image with nodejs

script:
# Run solhint
# make sure to modify the path to your contracts
- npx solhint '*.sol' -f sarif > solhint.sarif || true
# Install the DeepSource CLI and send the report to DeepSource
# Make sure you set the `DEEPSOURCE_DSN` env variable as a secret in your project.
- curl https://deepsource.io/cli | sh
- ./bin/deepsource report --analyzer solhint --analyzer-type community --value-file solhint.sarif

rules:
- if: $CI_PIPELINE_SOURCE == "push"

0 comments on commit e15aed3

Please sign in to comment.