forked from DmitryBurnaev/starlette-web
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (45 loc) · 1.19 KB
/
test.yaml
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
name: Test Web Project
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: "web_project"
POSTGRES_PASSWORD: "web_password"
POSTGRES_DB: "web_project"
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- name: Prepare .env file
env:
DB_NAME: "web_project"
DB_USERNAME: "web_project"
DB_PASSWORD: "web_password"
DB_HOST: "172.17.0.1"
DB_PORT: 5432
REDIS_HOST: "172.17.0.1"
REDIS_PORT: 6379
run: |
cp .env.template .env
env >> .env
ls -lah
- name: Build image
run: docker image build -t starlette-web .
- name: Run tests
run: docker run -t --env-file .env starlette-web