-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (50 loc) · 1.62 KB
/
unit_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
45
46
47
48
49
50
51
52
53
54
name: Unit tests
on: [push]
jobs:
run:
runs-on: ubuntu-20.04
env:
OS: ubuntu-20.04
PYTHON: '3.8'
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel coverage
- name: Generate Report
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
# The default PostgreSQL port
COVIGATOR_DB_NAME: postgres
COVIGATOR_DB_USER: postgres
COVIGATOR_DB_PASSWORD: postgres
COVIGATOR_DB_PORT: ${{ job.services.postgres.ports[5432] }}
COVIGATOR_DB_HOST: localhost
run: |
python setup.py bdist_wheel
pip install numpy==1.21.0
pip install dist/covigator*.whl
coverage run -m unittest discover covigator.tests.unit_tests
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3