Skip to content

Add pre-merge GitHub Actions workflow #1

Add pre-merge GitHub Actions workflow

Add pre-merge GitHub Actions workflow #1

Workflow file for this run

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