-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(slither): enable slither tests
- Loading branch information
1 parent
8c4edb6
commit 2b88580
Showing
1 changed file
with
69 additions
and
68 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 |
---|---|---|
@@ -1,70 +1,71 @@ | ||
name: Code Analysis | ||
|
||
#on: | ||
# push: | ||
# branches: [master, develop] | ||
# pull_request: | ||
# branches: [master, develop] | ||
# | ||
#jobs: | ||
# slither: | ||
# name: Solidity code analysis | ||
# runs-on: ubuntu-latest | ||
# | ||
# permissions: | ||
# contents: read | ||
# security-events: write | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# persist-credentials: false | ||
# | ||
# - run: corepack enable | ||
# | ||
# - uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: 20 | ||
# cache: 'pnpm' | ||
# | ||
# - name: Install dependencies | ||
# run: pnpm install | ||
# | ||
# # REVIEW: here and below steps taken from official guide | ||
# # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages | ||
# - name: Install poetry | ||
# run: > | ||
# pipx install poetry | ||
# | ||
# # REVIEW: | ||
# # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-adding-a-system-path | ||
# - name: Add poetry to $GITHUB_PATH | ||
# run: > | ||
# echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
# | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: '3.12' | ||
# cache: 'poetry' | ||
# | ||
# - name: Install dependencies | ||
# run: poetry install --no-root | ||
# | ||
# - name: Run slither | ||
# run: > | ||
# poetry run slither . --sarif results.sarif --no-fail-pedantic | ||
# | ||
# - name: Check results.sarif presence | ||
# id: results | ||
# if: always() | ||
# shell: bash | ||
# run: > | ||
# test -f results.sarif && | ||
# echo 'value=present' >> $GITHUB_OUTPUT || | ||
# echo 'value=not' >> $GITHUB_OUTPUT | ||
# | ||
# - name: Upload results.sarif file | ||
# uses: github/codeql-action/upload-sarif@main | ||
# if: ${{ always() && steps.results.outputs.value == 'present' }} | ||
# with: | ||
# sarif_file: results.sarif | ||
on: | ||
push: | ||
branches: [master, develop] | ||
pull_request: | ||
branches: [master, develop] | ||
|
||
jobs: | ||
slither: | ||
name: Solidity code analysis | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- run: corepack enable | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
# REVIEW: here and below steps taken from official guide | ||
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages | ||
- name: Install poetry | ||
run: > | ||
pipx install poetry | ||
# REVIEW: | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-adding-a-system-path | ||
- name: Add poetry to $GITHUB_PATH | ||
run: > | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-root | ||
|
||
- name: Run slither | ||
run: > | ||
poetry run slither . --sarif results.sarif --no-fail-pedantic | ||
- name: Check results.sarif presence | ||
id: results | ||
if: always() | ||
shell: bash | ||
run: > | ||
test -f results.sarif && | ||
echo 'value=present' >> $GITHUB_OUTPUT || | ||
echo 'value=not' >> $GITHUB_OUTPUT | ||
- name: Upload results.sarif file | ||
uses: github/codeql-action/upload-sarif@main | ||
if: ${{ always() && steps.results.outputs.value == 'present' }} | ||
with: | ||
sarif_file: results.sarif |