-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 1.71 KB
/
coverage.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
64
65
name: Coverage
on: ["push", "pull_request"]
jobs:
build:
name: Coverage
runs-on: ubuntu-latest
container: ubuntu:latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: rawl
POSTGRES_PASSWORD: s3cretpass
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install system dependencies
run: |
apt update
apt upgrade -y
apt install -y build-essential libpq-dev git curl
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.dev.txt
if [ -f requirements.txt ]; then
pip install -r requirements.txt
else
pip install -e .
fi
- name: Run Coverage
run: coverage run --source rawl -m pytest
env:
PG_DSN: postgresql://rawl:s3cretpass@postgres:5432/postgres
RAWL_DSN: postgresql://rawl:s3cretpass@postgres:5432/rawl_test
- name: Run Coverage
run: |
pytest --cov=./ --cov-report=xml
env:
PG_DSN: postgresql://rawl:s3cretpass@postgres:5432/postgres
RAWL_DSN: postgresql://rawl:s3cretpass@postgres:5432/rawl_test
- name: Upload to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
verbose: true