-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.34 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
48
49
50
51
52
name: Test Python Packages
on:
push:
branches: ["main"]
pull_request:
paths:
- "**/*.py"
jobs:
test-build:
timeout-minutes: 10
runs-on: ubuntu-20.04
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
strategy:
matrix:
include:
- python-version: "3.7"
os: ubuntu-20.04
- python-version: "3.13"
os: ubuntu-24.04
fail-fast: false
runs-on: ${{ matrix.os }}
container:
image: python:${{ matrix.python-version }}
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
if: ${{ github.event_name == 'pull_request' && matrix.python-version == '3.13' }}
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: coverage.xml
junitxml-path: results.xml