-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (57 loc) · 1.53 KB
/
test.yml
File metadata and controls
68 lines (57 loc) · 1.53 KB
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
name: 'Unit Tests'
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.x'
- 3.13
services:
rabbitmq:
image: rabbitmq
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- if: github.server_url != 'https://github.com'
run: sleep 20s
- uses: actions/checkout@v5
with:
submodules: true
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Type check
run: mypy servc --check-untyped-defs
- name: Run tests
env:
CACHE_URL: redis://${{ github.server_url != 'https://github.com' && 'redis' || 'localhost' }}
BUS_URL: amqp://guest:guest@${{ github.server_url != 'https://github.com' && 'rabbitmq' || 'localhost' }}
run: |
pip install coverage
coverage run -m unittest tests/*.py
coverage report -m --fail-under=60