-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (47 loc) · 1.26 KB
/
testing.yml
File metadata and controls
48 lines (47 loc) · 1.26 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
name: Python tests
on: [pull_request]
jobs:
lint:
name: Run tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.8]
services:
postgres:
image: postgres:11.5-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: rabbitmq and redis docker composes
run: |
cd api/
sh ./build-docker.sh
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry==1.1
- uses: actions/cache@v1
id: cache-poetry-deps
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-
- name: Install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: |
cd api/
poetry config virtualenvs.in-project true
poetry install
- name: Run tests
run: |
cd api/
poetry run pytest