Skip to content

Commit

Permalink
Merge branch 'master' into dart-analyze--azure-ci-snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
parth-deepsource authored Jan 31, 2024
2 parents 9f8e0dc + 3b46b83 commit 249e368
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
34 changes: 34 additions & 0 deletions analyzers/slither/CI/circleci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2.1

jobs:
run-slither:
docker:
- image: cimg/python:3.12.1-node
steps:
- checkout
- run:
name: Install Slither
command: |
python -m pip install --upgrade pip
pip3 install slither-analyzer
- run:
name: Run Slither
command: |
# 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
# Make sure you set the `DEEPSOURCE_DSN` env variable as a secret in your project.
- run:
name: Upload SARIF report to DeepSource
command: |
# Install the DeepSource CLI
curl https://deepsource.io/cli | sh
# Send the report to DeepSource
./bin/deepsource report --analyzer slither --analyzer-type community --value-file slither.sarif
workflows:
run-slither-workflow:
jobs:
- run-slither
6 changes: 3 additions & 3 deletions analyzers/slither/CI/github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
# Note that both `push` and `pull_request` triggers should be present for GitHub to consistently present slither
# SARIF reports.
push:
branches: [ main, master ]
branches: [main, master]
pull_request:

jobs:
Expand All @@ -16,11 +16,11 @@ jobs:
contents: read
security-events: write
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Run Slither
uses: crytic/[email protected]
Expand Down
30 changes: 30 additions & 0 deletions analyzers/solhint/CI/circleci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2.1

jobs:
run-solhint:
docker:
- image: cimg/node:16.20.2
steps:
- checkout
- run:
name: Install Solhint
command: |
npm install solhint@^4.1.1 # version installed should be greater than 4.1.1
- run:
name: Run solhint
command: |
# make sure to modify the path to your contracts
npx solhint '*.sol' -f sarif > solhint.sarif || true
# Make sure you set the `DEEPSOURCE_DSN` env variable as a secret in your project.
- run:
name: Upload SARIF report to DeepSource
command: |
# Install the DeepSource CLI
curl https://deepsource.io/cli | sh
# Send the report to DeepSource
./bin/deepsource report --analyzer solhint --analyzer-type community --value-file solhint.sarif
workflows:
run-solhint-workflow:
jobs:
- run-solhint

0 comments on commit 249e368

Please sign in to comment.