Push version to 0.1.9 #168
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Build image | |
run: docker image build -t starlette-web . | |
- name: Run tests | |
run: docker run -t --env-file .env starlette-web |