From c1ec7e3cd1fe6d4fc578430cf013b098611d5557 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 20:03:14 +0000 Subject: [PATCH] Add necessary services for GH actions without Docker --- .../.github/workflows/ci.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index c8bda217..c84d3eeb 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -37,6 +37,30 @@ jobs: # With no caching at all the entire ci process takes 4m 30s to complete! pytest: runs-on: ubuntu-latest + {%- if cookiecutter.use_docker == 'n' %} + + services: + {%- if cookiecutter.use_celery == 'y' %} + redis: + image: redis:5.0 + ports: + - 6379:6379 + {%- endif %} + postgres: + image: postgres:12 + ports: + - 5432:5432 + env: + POSTGRES_PASSWORD: postgres + + env: + {%- if cookiecutter.use_celery == 'y' %} + CELERY_BROKER_URL: "redis://localhost:6379/0" + {%- endif %} + # postgres://user:password@host:port/database + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" + {%- endif %} + steps: - name: Checkout Code Repository