-
Notifications
You must be signed in to change notification settings - Fork 20
62 lines (59 loc) · 2.15 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
56
57
58
59
60
61
62
name: Testing
on: workflow_call
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
sqlalchemy-version: [ 1.4 ]
django-version: [ 4.2 ]
name: Test Py ${{ matrix.python-version }}, SQLA ${{ matrix.sqlalchemy-version }}, Django ${{ matrix.django-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
- name: Install dependencies
run: |
sed -i.bak 's/^SQLAlchemy = .*/SQLAlchemy = "^${{ matrix.sqlalchemy-version }}"/' pyproject.toml
sed -i.bak 's/^Django = .*/Django = "^${{ matrix.django-version }}"/' pyproject.toml
poetry install
- name: Test with pytest
run: |
poetry run pytest -rfs --cov --cov-config=.coveragerc --cov-report="" --disable-warnings
cp .coverage ".coverage.${{ matrix.python-version }}-${{ matrix.sqlalchemy-version }}-${{ matrix.django-version }}"
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-reports-${{ matrix.python-version }}-${{ matrix.sqlalchemy-version }}-${{ matrix.django-version }}
include-hidden-files: true
path: ".coverage.${{ matrix.python-version }}-${{ matrix.sqlalchemy-version }}-${{ matrix.django-version }}"
coverage-check:
name: Coverage check
runs-on: ubuntu-20.04
needs: [test]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
pip3 install coverage==7.6.12
- name: Download coverage reports
uses: actions/download-artifact@v4
with:
pattern: coverage-reports-*
merge-multiple: true
path: coverage-reports
- name: Combine reports
run: |
coverage combine coverage-reports
coverage report --fail-under=100