From 226cb5bdf12fd25f13f841f76896a82e6f33843e Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Wed, 12 Jun 2024 13:20:40 -0400 Subject: [PATCH] feat: Add github actions for django tests --- .github/workflows/django_tests.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/django_tests.yml diff --git a/.github/workflows/django_tests.yml b/.github/workflows/django_tests.yml new file mode 100644 index 000000000..b175071e2 --- /dev/null +++ b/.github/workflows/django_tests.yml @@ -0,0 +1,29 @@ +name: django-tests +on: + pull_request: + types: [opened, synchronize] +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: mkdir -p config/envs + - uses: SpicyPizza/create-envfile@v2.0 + with: + envkey_POSTGRES_DB: test_cantusdb + envkey_POSTGRES_USER: test_user + envkey_POSTGRES_HOST: postgres + envkey_POSTGRES_PORT: 5432 + envkey_PROJECT_ENVIRONMENT: PRODUCTION + envkey_CANTUSDB_STATIC_ROOT: /path/to/static + envkey_CANTUSDB_MEDIA_ROOT: /path/to/media + envkey_CANTUSDB_HOST: somehost + envkey_CANTUSDB_SECRET_KEY: "hereisakey1234" + envkey_POSTGRES_PASSWORD: woahagreatpasswordabc + envkey_AWS_EMAIL_HOST_USER: test_user + envkey_AWS_EMAIL_HOST_PASSWORD: test_password + directory: config/envs + file_name: dev_env + - run: docker compose -f docker-compose-development.yml build + - run: docker compose -f docker-compose-development.yml up -d + - run: docker compose -f docker-compose-development.yml exec -T django python manage.py test main_app.tests \ No newline at end of file