-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.54 KB
/
run-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
name: Unit tests
on: push
jobs:
container_job:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9 ]
container: python:3.9-slim
services:
postgres:
image: postgres:12.7-alpine
# Provide the password for postgres
env:
POSTGRES_PASSWORD: boilerplate
POSTGRES_USER: boilerplate
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
apt update
apt install curl -y
pip install -r requirements/all.txt
# python -m pip install --upgrade pip
# pip install flit
# flit install --deps develop --symlink
# echo "GIT_COMMIT_HASH=\"test\"" > orchestrator/version.py
- name: Run Unit tests
run: PYTHONPATH=. DATABASE_URI=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB pytest --cov-branch --cov=server
env:
POSTGRES_DB: boilerplate-test
POSTGRES_USER: boilerplate
POSTGRES_PASSWORD: boilerplate
POSTGRES_HOST: postgres
# - name: "Upload coverage to Codecov"
# uses: codecov/codecov-action@v1
# with:
# fail_ci_if_error: true