Skip to content

Commit

Permalink
Add pre-merge.yml for PR check
Browse files Browse the repository at this point in the history
  • Loading branch information
goodsong81 committed May 31, 2024
1 parent 6ec9132 commit 1d80f03
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 62 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/pre_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Pre-Merge Checks

on:
push:
branches:
- develop
- releases/**
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch: # run on request (no need for PR)

# Declare default permissions as read only.
permissions: read-all

jobs:
Code-Quality-Checks:
# This is what will cancel the job concurrency
concurrency:
group: ${{ github.workflow }}-Linting-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox==4.4.6
- name: Code quality checks
run: tox -vv -e pre-commit

Unit-Test:
runs-on: ubuntu-22.04
needs: Code-Quality-Checks
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
tox-env: "py310"
- python-version: "3.11.8"
tox-env: "py311"
name: Unit-Test-${{ matrix.tox-env }}
# This is what will cancel the job concurrency
concurrency:
group: ${{ github.workflow }}-Unit-${{ github.event.pull_request.number || github.ref }}-${{ matrix.tox-env }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: python -m pip install tox==4.4.6
- name: Run unit test
run: tox -vv -e pytest-${{ matrix.tox-env }} -- tests/unit --cov=openvino_xai

Integration-Test:
runs-on: ubuntu-22.04
needs: Unit-Test
name: Integration-Test-py310
# This is what will cancel the job concurrency
concurrency:
group: ${{ github.workflow }}-Integration-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install --require-hashes --no-deps -r .ci/requirements/tox/requirements.txt
- name: Run Integration Test
run: tox -vv -e pytest-py310 -- tests/integration
62 changes: 0 additions & 62 deletions openvino_xai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,3 @@
__all__ = [
"insert_xai",
]


##------------------------
#
# from enum import Enum
# from abc import ABC
# from abc import abstractmethod
# import numpy as np
# import openvino.runtime as ov
#
#
# class XAI:
#
# class Task(Enum):
# CLASSIFICATION = "Classification"
# DETECTION = "Detection"
#
# class Mode(Enum):
# WHITEBOX = "whitebox"
# BLACKBOX = "blackbox"
# AUTO = "auto"
#
# class Target(Enum):
# IMAGE = "image"
# ALL = "all"
# CUSTOM = "custom"
#
# class Algorithm(ABC):
# @abstractmethod
# def run(self, image: np.ndarray):
#
# def __init__(
# self,
# model: ov.Model,
# ):
# pass
#
# def explain(
# self,
# image: np.ndarray,
# ):
# pass
#
#
#
#
##-------------------------
#
# from openvino_xai import XAI
##from openvino_xai.prepostproc import PreProcessor
##from openvino_xai.prepostproc import PostProcessor
#
#
# model = ov.Model()
# image = np.ndarray()
#
# xai = XAI(model)
# result = xai.explain(image)
# result = xai(image)
#
# explainer = Explainer(model)
# result = explainer(image)

0 comments on commit 1d80f03

Please sign in to comment.