forked from Azure/azure-iot-cli-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 1.59 KB
/
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
63
64
name: Tox tests
on:
workflow_call:
inputs:
continue-on-error:
type: boolean
required: false
default: false
workflow_dispatch:
inputs:
continue-on-error:
type: boolean
required: false
default: false
permissions:
contents: read
jobs:
unit-test:
name: Unit test ${{ matrix.py }} - ${{ matrix.os }}
continue-on-error: ${{ inputs.continue-on-error }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- windows
- macos
py:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- name: Setup python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- uses: actions/checkout@v4
- name: Install tox-gh
run: python -m pip install tox-gh tox==4.12.1
- name: Setup test suite
run: tox r -vv --notest
- name: Run test suite
run: tox r --skip-pkg-install
code-coverage:
name: Calculate code coverage
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run code coverage
run: |
python -m pip install tox==4.12.1
tox -e coverage
coverage=$(jq .totals.percent_covered coverage.json | cut -c1-4)
echo "Code coverage: $coverage%" >> $GITHUB_STEP_SUMMARY
- name: Upload code coverage
uses: actions/upload-artifact@v4
with:
path: ./htmlcov
name: code_coverage