-
Notifications
You must be signed in to change notification settings - Fork 46
57 lines (46 loc) · 1.35 KB
/
UnitTestRunner.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
# This workflow Runs Unit Tests using the specified python version(s) on
# windows-latest and ubuntu-latest
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
on:
workflow_call:
inputs:
python-versions:
description: 'Python Versions to use for Unit Tests. A Matrix is created from this'
required: true
type: string
jobs:
run:
name: Run
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ${{ fromJson(inputs.python-versions) }}
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install pip Dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -e .[dev]
- name: Run Unit Tests
run: coverage run -m pytest
- name: Format Coverage results
run: coverage xml
- name: Upload coverage to codecov
uses: codecov/codecov-action@v4
with:
verbose: false
- uses: actions/upload-artifact@v4
with:
name: Artifacts-${{matrix.os}}-${{matrix.python-version}}
path: |
pytest_report.html
test.junit.xml
if: failure()