Skip to content

Commit

Permalink
export env variables inside a .env file in the docker-startup-test wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
Alexdev8 committed Feb 14, 2024
1 parent 8132ce1 commit 0d5e341
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/startup-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ jobs:
startup-docker-compose-test:
runs-on: ubuntu-latest
env:
DJANGO_SUPERUSER_EMAIL: [email protected]
DJANGO_SUPERUSER_PASSWORD: 1234
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
COMPOSE_TEST: True
steps:
- uses: actions/checkout@v4
Expand All @@ -114,9 +111,18 @@ jobs:
run: npx playwright install --with-deps
- name: Build the Docker app
run: docker compose up -d --build
- name: Create backend environment variables file
working-directory: ${{ env.backend-directory }}
run: |
touch .env
echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env
echo [email protected] >> .env
echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env
export $(grep -v '^#' .env | xargs)
- name: Config the Docker app
run: |
docker compose exec backend python manage.py migrate
docker compose exec backend python manage.py createsuperuser --noinput
- name: Run tests
working-directory: ${{ env.working-directory }}
run: npx playwright test tests/functional/startup.test.ts
Expand Down

0 comments on commit 0d5e341

Please sign in to comment.