-
Notifications
You must be signed in to change notification settings - Fork 73
executable file
·58 lines (49 loc) · 1.37 KB
/
[Client]Unit Test When commit.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
name: Client_Unit Test When commit.yml
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./YuYuWechatV2_Client
services:
redis:
image: redis:latest
ports:
- 6379:6379
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: tykWyr-bepqu6-fafvym
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Run migrations
env:
DATABASE_URL: postgres://postgres:tykWyr-bepqu6-fafvym@localhost:5432/test_db
REDIS_URL: redis://localhost:6379
run: python manage.py migrate
- name: Run tests with coverage
env:
DATABASE_URL: postgres://postgres:tykWyr-bepqu6-fafvym@localhost:5432/test_db
REDIS_URL: redis://localhost:6379
run: |
coverage run --source='.' manage.py test --verbosity=3
coverage report
coverage xml -o coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}