-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.14 KB
/
test-python.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
name: Test Python Packages
on:
push:
branches: [ "main" ]
pull_request:
paths:
- "**/*.py"
jobs:
test-build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- run: |
pip install -U pip
pip install flit
flit build
test-package:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.11' ]
fail-fast: false
container:
image: python:${{ matrix.python-version }}-bullseye
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov
- name: Test with pytest
run: |
pytest --cov pytest_ignore_test_results --cov-report term-missing --cov-report xml --junitxml=results.xml
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: coverage.xml
junitxml-path: results.xml