-
Notifications
You must be signed in to change notification settings - Fork 11
68 lines (60 loc) · 2.11 KB
/
Copy pathpytest.yml
File metadata and controls
68 lines (60 loc) · 2.11 KB
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
permissions:
contents: "read"
on:
workflow_call:
inputs:
runs_on:
type: string
required: false
default: 'ubuntu-latest'
# Define the jobs to run in this workflow
jobs:
checks:
name: "Check with python-${{ matrix.python-version }}"
runs-on: ${{ inputs.runs_on }}
# Define a matrix strategy to run the job for multiple Python versions
strategy:
# Ensure all matrix jobs run even if one fails
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: "Install packages"
run: |
sudo -E apt-get -o Acquire::Retries=30 -qq update
sudo -E apt-get -o Acquire::Retries=30 -qq -y install file rsync
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# The commented part below implements parallell test execution with up to 16 workers. But
# coverage always shows 0%, so does not seem to work.
# - name: "Install dependencies"
# run: |
# python -m pip install --upgrade pip
# pip install --upgrade .
# pip install pytest pytest-xdist pytest-cov coverage
#
# - name: "Run pytest to execute tests and collect coverage data"
# run: |
# nproc=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1)
# [ "$nproc" -le 16 ] || nproc=16
# pytest -v --numprocesses "$nproc" --cov=pepclibs --cov=pepctools --cov-append
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install --upgrade .
pip install pytest coverage
- name: "Run pytest to execute tests and collect coverage data"
run: |
coverage run --module pytest -v
env:
SHELL: /bin/sh
- name: "Display the test coverage report"
run: |
if [ -e .coverage ]; then
coverage report
fi