update CI to generate coverage and reflect new test location

pull/1799/head
alpharush 2 years ago
parent 9a062453b7
commit 8fcedceb3f
  1. 51
      .github/workflows/IR.yml
  2. 48
      .github/workflows/compilation.yml
  3. 43
      .github/workflows/detectors.yml
  4. 44
      .github/workflows/features.yml
  5. 49
      .github/workflows/parser.yml
  6. 49
      .github/workflows/read_storage.yml
  7. 36
      .github/workflows/test.yml

@ -1,51 +0,0 @@
---
name: IR tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: IR tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
solc-select install 0.5.0
solc-select use 0.8.11 --always-install
- name: Install old solc
if: matrix.os == 'ubuntu-latest'
run: solc-select install 0.4.0
- name: Test with pytest
run: |
pytest tests/unit/slithir/

@ -1,48 +0,0 @@
---
name: Compilation tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Compilation tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
pushd tests/e2e/compilation/test_data/test_node_modules/
npm install hardhat
popd
- name: Test with pytest
run: |
pytest tests/e2e/compilation/

@ -1,43 +0,0 @@
---
name: Detectors tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Detectors tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Test with pytest
run: |
pytest tests/e2e/detectors/test_detectors.py

@ -1,44 +0,0 @@
---
name: Features tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Features tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Test with pytest
run: |
pytest tests/unit/core/

@ -1,49 +0,0 @@
---
name: Parser tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Parser tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Install solc
run: |
solc-select install all
solc-select use 0.8.0
- name: Test with pytest
run: |
pytest tests/e2e/solc_parsing/test_ast_parsing.py -n auto

@ -1,49 +0,0 @@
---
name: Test slither-read-storage
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Test slither-read-storage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install ganache
run: npm install --global ganache
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install python dependencies
run: |
pip install ".[dev]"
solc-select install 0.8.1
solc-select install 0.8.10
solc-select use 0.8.1
- name: Run slither-read-storage
run: |
pytest tests/tools

@ -33,44 +33,36 @@ jobs:
- name: Install dependencies
run: |
pip install ".[dev]"
solc-select install all
solc-select install 0.8.0
solc-select use 0.8.0
- name: Test detectors
- name: e2e / detectors
run: |
pytest --cov=slither --cov-append tests/test_detectors.py
pytest --cov=slither --cov-append tests/e2e/detectors/test_detectors.py -n auto
python -m coverage report
- name: Test features
- name: e2e / ast parsing
run: |
cd tests/test_node_modules/
npm install hardhat
cd ../..
pytest --cov=slither --cov-append tests/test_features.py
pytest --cov=slither --cov-append tests/test_constant_folding.py
pytest --cov=slither --cov-append tests/slithir/test_ternary_expressions.py
pytest --cov=slither --cov-append tests/slithir/test_operation_reads.py
pytest --cov=slither --cov-append tests/test_functions_ids.py
pytest --cov=slither --cov-append tests/test_function.py
pytest --cov=slither --cov-append tests/test_source_mapping.py
pytest --cov=slither --cov-append tests/test_storage_layout.py
pytest --cov=slither --cov-append pytest tests/e2e/solc_parsing/test_ast_parsing.py -n auto
python -m coverage report
- name: IR tests
- name: e2e / compilation
run: |
pytest --cov=slither --cov-append tests/test_ssa_generation.py
pushd tests/e2e/compilation/test_data/test_node_modules/
npm install hardhat
popd
pytest tests/e2e/compilation/
python -m coverage report
- name: Test ast parsing
- name: unit / core, slithir, utils
run: |
pytest --cov=slither --cov-append tests/test_ast_parsing.py -n auto
pytest --cov=slither --cov-append tests/unit/
python -m coverage report
- name: Test storage
- name: tools / slither-read-storage
run: |
npm install --global ganache
pytest --cov=slither --cov-append tests/test_read_storage.py
pytest --cov=slither --cov-append tests/tools/read-storage/test_read_storage.py
python -m coverage report
- uses: ./.github/actions/upload-coverage

Loading…
Cancel
Save