Skip to content

Commit

Permalink
Use dedicated setup for Github CI with .env.ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed May 15, 2024
1 parent 682b0e4 commit 98865d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .env.test → .env.ci
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
SECRET_KEY='some-development-secret'
DATABASE_URL=mysql://root:just-for-github-actions@127.0.0.1:3306/greencheck
DATABASE_URL_READ_ONLY=mysql://root:just-for-github-actions@127.0.0.1:3306/greencheck
RABBITMQ_URL=amqp://guest:guest@localhost:5672/
MAILGUN_API_KEY="nope"
DJANGO_SETTINGS_MODULE='greenweb.settings.testing'
SENTRY_DSN="https://test@sentry.io/test"
SENTRY_AUTH_TOKEN="nope"
SENTRY_ORG="nope"
PYTHONDONTWRITEBYTECODE=1
RABBITMQ_URL=amqp://guest:guest@localhost:5672/

MAXMIND_USER_ID = 123456
MAXMIND_LICENCE_KEY = "xxxxxxxxxxxxxxxx"
7 changes: 3 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ jobs:
uv venv
uv pip install -r requirements/requirements.linux.generated.txt
- name: Run tests
- name: Run tests, explictly using the python version of dotenv
run: |
source .venv/bin/activate
.venv/bin/dotenv -f .env.test run -- pytest
pytest
env:
AWS_SHARED_CREDENTIALS_FILE: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }}
AWS_CONFIG_FILE: ${{ secrets.AWS_CONFIG_FILE }}
RUNNING_IN_CI: true
8 changes: 5 additions & 3 deletions greenweb/settings/testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .common import * # noqa
import os

INTERNAL_IPS = ["127.0.0.1"]
ALLOWED_HOSTS.extend(["127.0.0.1", "localhost"]) # noqa
Expand Down Expand Up @@ -30,7 +31,8 @@
],
}

# we replace this with the autogenerated address for a specific trello board in production
TRELLO_REGISTRATION_EMAIL_TO_BOARD_ADDRESS = "mail-to-board@localhost"
DRF_LOGGER_INTERVAL = 1

DRF_LOGGER_INTERVAL=1
if os.getenv("RUNNING_IN_CI", False):
# add the settings specifcally for CI in github actions
environ.Env.read_env(".env.ci") # noqa

0 comments on commit 98865d2

Please sign in to comment.