-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ceb065
commit 14042e1
Showing
6 changed files
with
66 additions
and
39 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
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 |
---|---|---|
|
@@ -6,43 +6,70 @@ concurrency: | |
|
||
on: | ||
push: | ||
branches: [edge] | ||
paths-ignore: ["**.md"] | ||
branches: | ||
- edge | ||
paths-ignore: | ||
- "**.md" | ||
|
||
pull_request: | ||
paths-ignore: ["**.md"] | ||
paths-ignore: | ||
- "**.md" | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build and Run Application | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: | | ||
docker-compose.yml | ||
docker-compose.test.yml | ||
compose-flags: "--env-file test.env" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Check Application Health | ||
uses: jtalk/url-health-check-action@v3 | ||
with: | ||
url: http://localhost/api/v3/testConnection | ||
max-attempts: 10 | ||
retry-delay: 10s | ||
- name: Build and start Docker containers | ||
run: | | ||
docker-compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env up -d --build | ||
- name: Dump Application Logs | ||
if: failure() | ||
- name: Wait for application to be ready | ||
run: | | ||
echo "Health check failed. Dumping Docker logs..." | ||
docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env logs | ||
timeout=300 | ||
start_time=$(date +%s) | ||
while true; do | ||
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost/api/v3/testConnection) | ||
if [ $response -eq 200 ]; then | ||
echo "Application is ready!" | ||
break | ||
fi | ||
current_time=$(date +%s) | ||
elapsed=$((current_time - start_time)) | ||
if [ $elapsed -ge $timeout ]; then | ||
echo "Timeout waiting for application to be ready. Dumping logs:" | ||
docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env logs | ||
exit 1 | ||
fi | ||
sleep 5 | ||
done | ||
- name: Cypress Run | ||
uses: cypress-io/github-action@v5 | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
config: baseUrl=http://localhost | ||
spec: cypress/e2e/!(third-party)/**/*.cy.js | ||
working-directory: e2e | ||
|
||
- name: Upload Cypress screenshots | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: e2e/cypress/screenshots | ||
|
||
- name: Upload Cypress videos | ||
uses: actions/upload-artifact@4 | ||
if: failure() | ||
with: | ||
name: cypress-videos | ||
path: e2e/cypress/videos | ||
|
||
- name: Stop Docker containers | ||
if: always() | ||
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env down |
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
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
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
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