Skip to content

Revert "Local shap toolbox" #62

Revert "Local shap toolbox"

Revert "Local shap toolbox" #62

# Pre-merge Checks (for Python projects)
# 1. Unit tests with code coverage (pytest)
# 2. Code quality analysis (flake8)
# 3. Dependency analysis (vulnerabilities)
# 4. Dependency analysis (undesirable licenses)
# 5. Deploy reports generated from the above to GitHub Pages
name: Pre-Merge Checks (plugin-st)
on:
# Runs when a pull request to main is being assigned
pull_request:
types: [ assigned, synchronize ]
branches:
- 'main'
paths:
- 'stock-plugins/aiverify.stock.shap-toolbox/**'
# Run this workflow manually from Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
pre-merge-checks:
# Run only when PR is assigned, even on subsequent commits (i.e. synchronize)
if: (github.event_name == 'pull_request' && github.event.pull_request.assignee != null) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: |
test-engine-core-modules
stock-plugins/aiverify.stock.shap-toolbox
# Install dependencies
- name: Setup pip cache/install
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: stock-plugins/aiverify.stock.shap-toolbox
- name: Install dependencies for core-modules
working-directory: ${{ github.workspace }}/test-engine-core-modules
run: |
pip install -r requirements.txt
- name: Install dependencies for plugin
working-directory: ${{ github.workspace }}/stock-plugins/aiverify.stock.shap-toolbox
run: |
cd algorithms/*/
curl -H 'Authorization: token ${{ secrets.CHECKOUT_TOKEN }}' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/aiverify-foundation/aiverify/contents/test-engine-core/dist/test_engine_core-0.9.0.tar.gz
pip install -r requirements.txt
pip install test_engine_core-0.9.0.tar.gz
pip install pytest pytest-mock pytest-html pytest-json pytest-cov coverage
pip install flake8 flake8-html anybadge
# Unit Tests & Coverage
- name: Unit tests with coverage
working-directory: ${{ github.workspace }}/stock-plugins/aiverify.stock.shap-toolbox
if: ${{ ! cancelled() }}
timeout-minutes: 30
run: |
cd algorithms/*/
bash ci/run-test.sh -m
# flake8
- name: Code quality analysis - lint
working-directory: ${{ github.workspace }}/stock-plugins/aiverify.stock.shap-toolbox
if: ${{ ! cancelled() }}
run: |
cd algorithms/*/
bash ci/run-flake8.sh
- name: Uninstall dependencies (core-modules & dev)
working-directory: ${{ github.workspace }}/test-engine-core-modules
if: ${{ ! cancelled() }}
run: |
pip uninstall -y -r requirements.txt
pip uninstall -y pytest pytest-mock pytest-html pytest-json pytest-cov coverage
# pip-audit
- name: Dependency analysis - vulnerabilities & licenses
working-directory: ${{ github.workspace }}/stock-plugins/aiverify.stock.shap-toolbox
if: ${{ ! cancelled() }}
run: |
cd algorithms/*/
bash ci/run-pip-audit.sh
### Publish reports to ci dashboard ###
- name: Checkout dashboard
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && always() }}
uses: actions/checkout@v3
with:
repository: aiverify-foundation/ci-dashboard
token: ${{ secrets.CHECKOUT_TOKEN }}
ref: main
path: check-results
- name: Push results to dashboard
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && always() }}
working-directory: ${{ github.workspace }}/check-results
run: |
set +e
find ../ -type f -name ".gitignore" -exec rm {} +
[ -d "docs/pre-merge/plugin-st" ] && rm -rf docs/pre-merge/plugin-st
mkdir -p docs/pre-merge/plugin-st
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/htmlcov docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/flake8-report docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/assets docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/*.svg docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/*.html docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/*.md docs/pre-merge/plugin-st/
mv ../stock-plugins/aiverify.stock.shap-toolbox/algorithms/*/*.txt docs/pre-merge/plugin-st/
git add docs/pre-merge/plugin-st
git config user.name "aiverify"
git config user.email "[email protected]"
git commit -m "feat(portal) actions publish plugin-st reports to dashboard"
git push
set -e