-
Notifications
You must be signed in to change notification settings - Fork 120
61 lines (52 loc) · 1.63 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
name: pytest
on:
pull_request:
workflow_dispatch:
jobs:
pytest:
name: "pytest"
permissions:
issues: write
pull-requests: write
strategy:
fail-fast: false
matrix:
include:
- name: "CentOS Stream 10"
image: "quay.io/centos/centos:stream10-development"
pytest_args: ''
- name: "Fedora latest"
image: "registry.fedoraproject.org/fedora:latest"
pytest_args: ''
- name: "Fedora Rawhide"
image: "registry.fedoraproject.org/fedora:rawhide"
pytest_args: ''
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
volumes:
- /tmp:/tmp
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Run container-pre-test.sh"
run: |
bash scripts/container-pre-test.sh
- name: "Run pytest"
env:
PYTEST_ADDOPTS:
"--color=yes --code-highlight=yes --showlocals
--cov 'src/' --cov-report 'term:skip-covered'
--cov-report 'xml:/tmp/coverage.xml' --junitxml '/tmp/pytest.xml'"
run: |
python3 -m pytest ${{ matrix.pytest_args }}
- name: "Publish coverage"
uses: MishaKav/pytest-coverage-comment@main
if: |
github.event.pull_request.head.repo.full_name == github.repository
&& matrix.name == 'Fedora latest'
with:
title: "Coverage (computed on ${{ matrix.name }})"
report-only-changed-files: true
pytest-xml-coverage-path: /tmp/coverage.xml
junitxml-path: /tmp/pytest.xml