forked from ecamp/ecamp3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: use image in docker compose again to run e2e tests
- Loading branch information
Showing
2 changed files
with
31 additions
and
6 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 |
---|---|---|
|
@@ -52,12 +52,15 @@ jobs: | |
# start necessary containers | ||
- run: docker compose up -d api frontend pdf print browserless database docker-host http-cache mail | ||
|
||
- uses: cypress-io/[email protected] | ||
with: | ||
working-directory: e2e | ||
browser: ${{ matrix.browser }} | ||
wait-on: 'http://localhost:3000, http://localhost:3000/api, http://localhost:3000/print/health' | ||
wait-on-timeout: 300 | ||
# pull cypress while container are starting up | ||
- run: docker compose pull e2e | ||
|
||
- run: sh -x wait-for-container-startup.sh | ||
|
||
- run: docker compose --profile e2e run --rm e2e --browser ${{ matrix.browser }} | ||
|
||
- run: sudo chown -R $USER e2e | ||
if: always() | ||
|
||
# store screenshots and videos on GitHub as artifacts, for downloading and debugging in case of problems | ||
- uses: actions/upload-artifact@v4 | ||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Waiting for API container to start up and migrate DB..." | ||
until curl --output /dev/null --silent --fail http://localhost:3000/api | ||
do | ||
sleep 2 | ||
done | ||
echo "API container is ready." | ||
|
||
echo "Waiting for print container to start up..." | ||
until curl --output /dev/null --silent --fail http://localhost:3000/print/health | ||
do | ||
sleep 2 | ||
done | ||
echo "Frontend container is ready." | ||
|
||
echo "Waiting for frontend container to start up..." | ||
until curl --output /dev/null --silent --fail http://localhost:3000 | ||
do | ||
sleep 2 | ||
done | ||
echo "Frontend container is ready." |