-
Notifications
You must be signed in to change notification settings - Fork 55
66 lines (57 loc) · 1.63 KB
/
zango-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
55
56
57
58
59
60
61
62
63
64
65
66
name: Zango tests
on:
pull_request:
push:
branches: main
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U zango"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
# Step 1: Checkout repo
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Setup up python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # Specify the Python version you need
# Step 3: Install dependencies
- name: Install local zango package
run: |
python -m pip install -e ./backend
# Step 4: Setup up environment variables
- name: Set up environment variables
shell: bash
run: |
cat <<EOF > backend/test_project/.env
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mysecretpassword
POSTGRES_DB=postgres
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
PLATFORM_DOMAIN_URL=localhost
PROJECT_NAME=test_project
EOF
# Step 5: Run tests
- name: Run tests
run: |
chmod +x ./runtests.sh
./runtests.sh
- name: Show coverage
run: |
mv backend/test_project/.coverage* .
coverage report --fail-under=45 -m --ignore-errors # TODO: change 50% to 80%