From 491ba9654d423ac41396be057bafbf4fc133615a Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Thu, 4 Jul 2024 17:13:51 +0200 Subject: [PATCH] Switch the CI to PostgreSQL --- .github/workflows/python-app.yml | 12 +++++++++++- app/settings.py | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0fc869c..762b3d6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,6 +10,16 @@ jobs: build: runs-on: ubuntu-latest + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: ["5432:5432"] + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: - uses: actions/checkout@v3 - name: Set up Python 3.12 @@ -23,7 +33,7 @@ jobs: - name: Test with the Django testsuite env: ALLOWED_HOSTS: '["*"]' - DATABASE_URL: "sqlite://traduire.db" + DATABASE_URL: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres DEBUG: "True" LIVE: "False" NAMESPACE: "test" diff --git a/app/settings.py b/app/settings.py index 24a4594..321cc8e 100644 --- a/app/settings.py +++ b/app/settings.py @@ -31,7 +31,6 @@ DATABASES = {"default": django_database_url(env("DATABASE_URL", required=True))} DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" - SECRET_KEY = env("SECRET_KEY", required=True) TIME_ZONE = "Europe/Zurich"