-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.34 KB
/
tests.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
name: tests
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Run Docker Compose
run: docker-compose up -d
- name: Install Wait For It Ubuntu package
run: sudo apt-get install wait-for-it
- name: Wait until PostgreSQL is ready
run: wait-for-it 127.0.0.1:15432 --timeout=20
- name: Set up Python ${{ matrix.version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
set -ex
curl -sSL https://install.python-poetry.org | python3 -
$HOME/.local/bin/poetry install
- name: Copy env.example to .env
run: |
set -ex
test -f env.example && cp -a env.example .env || echo "env.example doesn't exist. It's OK"
- name: Test with pytest
run: |
set -ex
$HOME/.local/bin/poetry run coverage run -m pytest
- name: Convert coverage to XML
run: |
set -ex
$HOME/.local/bin/poetry run coverage xml
- name: Upload coverage to codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bash <(curl -s https://codecov.io/bash)