forked from chaychoong/coveragepy-lcov
-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (77 loc) · 2.34 KB
/
pytest.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
# This workflow will run tests on PRs
name: PyTest On PR
on:
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.platform }} / ${{ matrix.python-version }}
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- "3.10"
- "3.11"
- "3.12"
platform:
- ubuntu-20.04
- macos-latest
- macos-13
- windows-latest
exclude:
# 3.6, 3.7 doesn't exist as a runner on arm64 macs
- python-version: 3.6
platform: macos-latest
- python-version: 3.7
platform: macos-latest
runs-on: "${{ matrix.platform }}"
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Setup poetry
uses: abatilo/actions-poetry@v2
- name: Update PATH
if: ${{ matrix.platorm != 'windows-latest' }}
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Update Path for Windows
if: ${{ matrix.platform == 'windows-latest' }}
shell: bash
run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true
- name: Poetry check & build
shell: bash
run: poetry check && poetry build
- name: Install dependencies
shell: bash
run: poetry install
- name: Mypy
shell: bash
run: poetry run mypy .
- name: Mypy
shell: bash
run: poetry run pylint coverage_lcov tests
- name: PyTest
shell: bash
run: poetry run coverage run --source=coverage_lcov -m pytest tests && poetry run coverage report
- name: Eat our own dog food
shell: bash
run: poetry run coverage-lcov
- name: Report code coverage
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.9' }}
uses: zgosalvez/github-actions-report-lcov@v1
with:
coverage-files: lcov.info
minimum-coverage: 0
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: coverage_lcov