-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 2.08 KB
/
test.yaml
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
69
70
71
72
73
74
75
76
77
78
79
name: lint-test-coverage
on: [ push, workflow_call ]
env:
MAX_PYTHON_V: 3.12
EXTRA_DEPS: dev,dev-fastapi,dev-sanic,dev-sqlalchemy
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAX_PYTHON_V }}
cache: 'pip'
- name: Install deps
run: |
python -m pip install -U pip
python -m pip install -e .[$EXTRA_DEPS]
- name: Lint
run: ./scripts/lint.sh
test:
runs-on: ubuntu-latest
strategy:
matrix:
py-v: [ "3.10", "3.11", "3.12" ]
env:
COVERAGE_FILE: .coverage.py-${{ matrix.py-v }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py-v }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py-v }}
cache: 'pip'
- name: Install deps
run: |
python -m pip install -U pip
python -m pip install -e .[$EXTRA_DEPS]
- name: Test
run: ./scripts/cov.sh
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: ${{ env.COVERAGE_FILE }}
path: ${{ env.COVERAGE_FILE }}
if-no-files-found: error
retention-days: 14
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAX_PYTHON_V }}
- name: Download coverage
uses: actions/download-artifact@v4
with:
path: cov
pattern: .coverage.py-*
merge-multiple: true
- name: Merge coverage
run: |
pip install -U coverage
coverage combine --keep ./cov/
coverage xml
coverage report
- name: Upload coverage-total
uses: actions/upload-artifact@v4
with:
name: coverage-total
path: coverage.xml
if-no-files-found: error
retention-days: 14