generated from nyu-devops/project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (55 loc) · 1.48 KB
/
bdd.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
name: BDD Tests
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '**.md'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
container: rofrano/pipeline-selenium:latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_PASSWORD: pgs3cr3t
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:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install -U pip poetry
poetry config virtualenvs.create false
poetry install
- name: Run the service locally
run: |
echo "\n*** STARTING APPLICATION ***\n"
gunicorn --log-level=info --bind=0.0.0.0:8080 wsgi:app &
echo "Waiting for service to stabilize..."
sleep 5
echo "Checking service /health..."
curl -i http://localhost:8080/health
echo "\n*** SERVER IS RUNNING ***"
env:
DATABASE_URI: "postgresql+psycopg://postgres:pgs3cr3t@postgres:5432/testdb"
- name: Run Integration Tests
run: behave