-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (56 loc) · 1.69 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
name: test-workflow
on:
push:
jobs:
lint:
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
name: Lint ${{ matrix.python-version }}
runs-on: 'ubuntu-20.04'
container: python:${{ matrix.python-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install -r requirements-lint.txt
- name: Lint code
run: |
ruff check
ruff format --check
ruff check --select I
# Run tests
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
os: ['ubuntu-20.04']
requirements: ["requirements_tests"]
redis-version: [4, 5, 6, 7]
redis-py-version: [3.3.0, 4.6.0]
# Do not cancel any jobs when a single job fails
fail-fast: false
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with ${{ matrix.requirements }} and Redis ${{ matrix.redis-version }} and redis-py==${{ matrix.redis-py-version }}
runs-on: ${{ matrix.os }}
container: python:${{ matrix.python-version }}
services:
redis:
image: redis:${{ matrix.redis-version }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install -r ${{ matrix.requirements }}.txt
- name: Run tests
run: pytest
env:
REDIS_TEST_HOST: redis
REDIS_TEST_DB: 0