forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (62 loc) · 2.09 KB
/
run_tests_in_tox.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
on:
workflow_call:
inputs:
python-version:
type: string
default: "3.10"
toxenv-pyver:
description: "[py38, py39, py310]"
type: string
default: "py310"
toxenv-task:
description: "[all, act, ano, cls, det, seg, iseg]"
type: string
default: "all"
tests-dir:
type: string
default: ""
timeout-minutes:
type: number
default: 720
upload-artifact:
type: boolean
default: false
runs-on:
type: string
default: "['self-hosted', 'Linux', 'X64', 'dev']"
task:
type: string
default: "undefined"
artifact-prefix:
type: string
default: "test-results"
toxenv-ptver:
type: string
default: "pt1"
jobs:
run_tests_in_tox:
# tricky workaround to pass list from the string input type
# https://github.com/orgs/community/discussions/11692
runs-on: ${{ fromJson(inputs.runs-on) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
run: python -m pip install -r requirements/dev.txt
- name: Run Tests
run: tox -vv -e tests-${{ inputs.toxenv-task }}-${{ inputs.toxenv-pyver }}-${{ inputs.toxenv-ptver }} -- ${{ inputs.tests-dir }}
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact-prefix }}-${{ inputs.toxenv-task }}-${{ inputs.toxenv-pyver }}-${{ inputs.toxenv-ptver }}
path: |
.tox/tests-${{ inputs.toxenv-task }}-${{ inputs.toxenv-pyver }}-${{ inputs.toxenv-ptver }}.csv
.tox/tests-reg_${{ inputs.task }}_*.csv
.tox/tests-reg_tiling_${{ inputs.task }}_*.csv
# Use always() to always run this step to publish test results when there are test failures
if: ${{ inputs.upload-artifact && always() }}