-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
export env variables inside a .env file in the docker-startup-test wo…
…rkflow
- Loading branch information
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|