-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.43 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
name: test
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
pytest:
name: Run pytest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7]
services:
redis:
image: redis
ports:
- 6379:6379
memcached:
image: memcached
ports:
- 11211:11211
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]" -i https://mirrors.aliyun.com/pypi/simple
- name: Lint with flake8
run: flake8 src tests
- name: Test with pytest
run: pytest --cov-report=xml --benchmark-skip
- name: Upload coverage to Codecov
if: success() && matrix.python-version == 3.7
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}