-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (101 loc) · 3.83 KB
/
pre_merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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 dev-${{ matrix.tox-env }} -- tests/unit --csv=.tox/dev-${{ matrix.tox-env }}/unit-test.csv
--cov=openvino_xai --cov-report term --cov-report xml:.tox/dev-${{ matrix.tox-env }}/unit-test-coverage.xml
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: unit-test-results-${{ matrix.tox-env }}
path: |
.tox/dev-${{ matrix.tox-env }}/*.csv
.tox/dev-${{ matrix.tox-env }}/*.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: .tox/dev-${{ matrix.tox-env }}/unit-test-coverage.xml
flags: dev-${{ matrix.tox-env }}
Integration-Test:
runs-on: ubuntu-22.04
needs: Unit-Test
name: Integration-Test
# 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 tox==4.4.6
- name: Run Integration Test
run: tox -vv -e dev-py310 -- tests/integration --csv=.tox/dev-py310/intg-test.csv
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: intg-test-results
path: .tox/dev-py310/*.csv
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}