Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark updates #143

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- name: Configure
run: |
cd slitherin-benchmark/
ls
mv example.config.py config.py
- name: Install node dependencies
run: npm ci
Expand All @@ -44,12 +45,26 @@ jobs:
- name: Run Benchmark
run: |
cd slitherin-benchmark/
python runner.py -i contracts/mainnet -o mainnet.csv --limit 7000
python runner.py -i contracts/mainnet -o mainnet.csv -eo mainnet_extra.csv --limit 8000 --skip-duplicates --skip-libs
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
python save_sheet.py -i mainnet.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln mainnet -pr $PR_NUMBER
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
PR_NUMBER: ${{ github.event.number }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: mainnet
path: slitherin-benchmark/mainnet.csv
- name: 'Upload Artifact Extra'
uses: actions/upload-artifact@v3
with:
name: mainnet
path: slitherin-benchmark/mainnet_extra.csv
RunBenchmarkOZ:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -89,6 +104,15 @@ jobs:
run: |
cd slitherin-benchmark/
python runner.py -i contracts/openzeppelin -o oz.csv -eo oz_extra.csv
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
python save_sheet.py -i oz.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln OZ -pr $PR_NUMBER
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
PR_NUMBER: ${{ github.event.number }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
Expand All @@ -99,4 +123,3 @@ jobs:
with:
name: oz_extra
path: slitherin-benchmark/oz_extra.csv

118 changes: 118 additions & 0 deletions .github/workflows/old_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Run Benchmark

on:
workflow_dispatch: # Ручной запуск через UI Гитхаба
jobs:
RunBenchmarkOld:
runs-on: ubuntu-latest
env:
slitherin_version: 0.1.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install solc-select
run: python -m pip install solc-select
- name: Install Slither
run: python -m pip install slither-analyzer
- name: Install Setuptools
run: python -m pip install setuptools
- name: Install Slitherin
run: python -m pip install slitherin==$slitherin_version
- name: Configure
run: |
cd slitherin-benchmark/
mv example.config.py config.py
- name: Install benchmark requirements
run: |
cd slitherin-benchmark/
python -m pip install -r requirements.txt
- name: Run Benchmark
run: |
cd slitherin-benchmark/
python runner.py -i contracts/mainnet -o mainnet.csv --limit 8000 --skip-duplicates --skip-libs --use-slither
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
python save_sheet.py -i mainnet.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln mainnet -sv "slitherin $slitherin_version"
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: mainnet
path: slitherin-benchmark/mainnet.csv
RunBenchmarkOZOld:
runs-on: ubuntu-latest
env:
slitherin_version: 0.1.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install solc-select
run: python -m pip install solc-select
- name: Install Slither
run: python -m pip install slither-analyzer
- name: Install Setuptools
run: python -m pip install setuptools
- name: Install Slitherin
run: python -m pip install slitherin==$slitherin_version
- name: Configure
run: |
cd slitherin-benchmark/
mv example.config.py config.py
- name: Install node dependencies
run: npm ci
- name: Install benchmark requirements
run: |
cd slitherin-benchmark/
python -m pip install -r requirements.txt
- name: Run Benchmark
run: |
cd slitherin-benchmark/
python runner.py -i contracts/openzeppelin -o oz.csv -eo oz_extra.csv --use-slither
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
ls
python save_sheet.py -i oz.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln OZ -sv "slitherin $slitherin_version"
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: oz
path: slitherin-benchmark/oz.csv
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: oz_extra
path: slitherin-benchmark/oz_extra.csv

Loading