-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 1.91 KB
/
Copy pathpytest-coverage.yml
File metadata and controls
76 lines (62 loc) · 1.91 KB
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
name: PyTest with Coverage
on:
workflow_call:
inputs:
setup-path:
type: string
default: "."
test-path:
type: string
default: ""
requirements-file:
type: string
default: "test-requirements.txt"
repository:
type: string
default: ${{ github.repository }}
python-versions:
type: string
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
runners:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
fail-fast:
type: boolean
default: true
jobs:
pytest-coverage:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}
runner: ${{ fromJSON(inputs.runners) }}
name: PyTest & Coverage (Python ${{ matrix.python-version }} [${{ matrix.runner }}])
steps:
- name: Checkout Repo
uses: actions/checkout@v7
with:
repository: ${{ inputs.repository }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade Pip
run: |
python -m pip install --upgrade pip
- name: Install Tools (Wheel, Setuptools, Pytest, Coverage)
run: |
pip install wheel setuptools pytest coverage
- name: Install Testing Requirements
if: ${{ hashFiles(inputs.requirements-file) != '' }}
run: |
pip install -r ${{ inputs.requirements-file }}
- name: Build & Install Repo
run: |
pip install -e ${{ inputs.setup-path }}
- name: Run PyTest
run: |
coverage run -m pytest -v ${{ inputs.test-path }} --color=yes
- name: Check Coverage
run: |
coverage report