-
Notifications
You must be signed in to change notification settings - Fork 14
55 lines (43 loc) · 1.39 KB
/
testing.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
name: Testing
on: [pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit pytest pytest-cov pytest-github-actions-annotate-failures
flit install
- name: Cache for pytest
uses: actions/cache@v3
env:
cache-name: cache_pytest
with:
path: ~/.cache/pytest_env
key: ${{ env.cache-name }}_${{ runner.os }}_${{ env.pythonLocation }}
restore-keys: |
- ${{ env.cache-name }}_${{ runner.os }}
- ${{ env.cache-name }}
- name: Test with pytest
run: |
pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}