-
-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (70 loc) · 2.05 KB
/
server-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
63
64
65
66
67
68
69
70
71
72
73
74
75
name: server tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test-runners:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
env:
SHIPPER_SECRET_KEY: "duk4hvedu3zxnmw@shnjw7z^)x#wcm@cj05t5fZrx-g44d2"
SHIPPER_DEBUG: 1
SHIPPER_ALLOWED_HOSTS: "localhost 127.0.0.1"
SHIPPER_CSRF_TRUSTED_ORIGINS: "http://localhost/"
SHIPPER_SECURE_SSL_REDIRECT: 0
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
working-directory: ./server
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Run Tests
working-directory: ./server
run: |
python manage.py test
- name: Generate coverage report
working-directory: ./server
run: |
coverage run manage.py test
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ${{ github.workspace }}/server/.coverage.*
codecov-coverage:
runs-on: ubuntu-latest
needs: test-runners
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
- name: Download coverage reports from all runners
uses: actions/download-artifact@v3
with:
name: coverage-data
- name: Combine coverage reports and generate Cobertura XML report
run: |
coverage combine
coverage xml
- name: Upload finalized coverage report
uses: codecov/[email protected]
with:
verbose: true
fail_ci_if_error: true