-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (52 loc) · 1.46 KB
/
bdd-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
name: BDD Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
# use a known build environment
container: python:3.9
# Required services
services:
# Label used to access the service container
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Steps for the build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl wget python3-selenium
- name: Install packages
run: |
python -m pip install --upgrade pip wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run the server locally
run: |
echo "\n*** STARTING APPLICATION ***\n"
gunicorn --log-level=critical --bind=0.0.0.0:5000 service:app &
sleep 5
curl -I http://localhost:5000/
echo "\n*** SERVER IS RUNNING ***"
env:
DATABASE_URI: "postgres://postgres:postgres@postgres:5432/testdb"
- name: Run unit tests with behave
run: behave