-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (58 loc) · 1.67 KB
/
tests.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
62
---
name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
DEFAULT_PYTHON: "3.11"
jobs:
pytest:
name: Testing on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: 🐍 Setup Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: 🚧 Install dependencies
run: pip install . .[test]
- name: 🚀 Run Pytest
run: pytest --cov pypaperless tests
- name: ⬆️ Upload coverage
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
coverage:
name: Coverage report
runs-on: ubuntu-latest
needs: pytest
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: ⬇️ Download coverage
uses: actions/[email protected]
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: 🚧 Install dependencies
run: pip install . .[test]
- name: 🚀 Process coverage results
run: |
coverage combine coverage*/.coverage*
coverage xml -i
- name: ⬆️ Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml