Skip to content

Commit 9ecdd99

Browse files
committed
ci: update workflow with cleanup and logs
1 parent 5b6af31 commit 9ecdd99

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

.github/workflows/playwright-allure.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ jobs:
2929
- name: Install Playwright Browsers
3030
run: npx playwright install --with-deps
3131

32+
- name: Clean up conflicting DB data
33+
run: |
34+
sudo rm -rf postgres-data
35+
sudo rm -rf pgdata
36+
sudo rm -rf .postgres-data
37+
3238
- name: Create and Source .env
3339
run: |
34-
# إنشاء الملف
3540
echo "DB_USER=postgres" >> .env
3641
echo "DB_PASSWORD=your_secure_password" >> .env
3742
echo "DB_NAME=postgres" >> .env
@@ -40,22 +45,14 @@ jobs:
4045
echo "POSTGRES_USER=postgres" >> .env
4146
echo "POSTGRES_PASSWORD=your_secure_password" >> .env
4247
echo "POSTGRES_DB=postgres" >> .env
43-
44-
# قراءة المحتوى للتأكد
45-
cat .env
4648
4749
- name: Start Services
4850
run: |
4951
source .env
5052
docker compose up -d --build
5153
52-
- name: Wait for Services & Debug
53-
run: |
54-
sleep 30
55-
docker ps -a
56-
docker logs automation_pg_container || true
57-
58-
# --------------------------------------------------------
54+
- name: Wait for Services
55+
run: sleep 30
5956

6057
- name: Run Playwright tests
6158
run: npx playwright test --reporter=line,allure-playwright
@@ -65,7 +62,7 @@ jobs:
6562
- name: Load test report history
6663
uses: actions/checkout@v3
6764
if: always()
68-
continue-on-error: true # ه
65+
continue-on-error: true
6966
with:
7067
ref: gh-pages
7168
path: gh-pages

.github/workflows/playwright.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16+
1617
- uses: actions/setup-node@v4
1718
with:
1819
node-version: 18
@@ -23,6 +24,11 @@ jobs:
2324
- name: Install Playwright Browsers
2425
run: npx playwright install --with-deps
2526

27+
- name: Clean up conflicting DB data
28+
run: |
29+
sudo rm -rf pgdata
30+
sudo rm -rf postgres-data
31+
2632
- name: Create .env file
2733
run: |
2834
echo "DB_USER=postgres" >> .env
@@ -40,13 +46,13 @@ jobs:
4046
- name: Wait for Services
4147
run: sleep 30
4248

43-
- name: Debug DB Logs on Failure
44-
if: failure()
45-
run: docker logs automation_pg_container
46-
4749
- name: Run Playwright tests
4850
run: npx playwright test
4951

52+
- name: Debug DB on Failure
53+
if: failure()
54+
run: docker logs automation_pg_container
55+
5056
- uses: actions/upload-artifact@v4
5157
if: always()
5258
with:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
# Playwright
33
node_modules/
44
/test-results/
5+
allure-results/
56
/playwright-report/
67
/blob-report/
78
/playwright/.cache/
9+
postgres-data/
10+
pgdata/
11+
*.log
812
/playwright/.auth/
913
.env

0 commit comments

Comments
 (0)