-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dart-analyze--azure-ci-snippet
- Loading branch information
Showing
3 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |