Skip to content

Commit f2a87ff

Browse files
committed
ci: Enable both workflows with full Docker support
1 parent dd05fab commit f2a87ff

File tree

2 files changed

+57
-60
lines changed

2 files changed

+57
-60
lines changed
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
name: Professional QA Pipeline
1+
name: Playwright Tests & Allure Report
2+
23
on:
34
push:
4-
branches: [ main, master ]
5+
branches: [ main, master, feat/* ]
56
pull_request:
67
branches: [ main, master ]
78

89
permissions:
9-
contents: read
10+
contents: write
1011
pages: write
1112
id-token: write
1213

1314
jobs:
14-
e2e-testing:
15+
test:
16+
timeout-minutes: 60
1517
runs-on: ubuntu-latest
16-
17-
services:
18-
postgres:
19-
image: postgres:latest
20-
env:
21-
POSTGRES_USER: postgres
22-
POSTGRES_PASSWORD: password123
23-
POSTGRES_DB: automation_db
24-
ports:
25-
- 5432:5432
26-
options: >-
27-
--health-cmd pg_isready
28-
--health-interval 10s
29-
--health-timeout 5s
30-
--health-retries 5
3118

3219
steps:
33-
- name: Checkout Code
34-
uses: actions/checkout@v4
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
3524

36-
- name: Setup Node.js
37-
uses: actions/setup-node@v4
38-
with:
39-
node-version: 18
25+
- name: Install dependencies
26+
run: npm install
4027

41-
- name: Install Project Dependencies
42-
run: npm install
28+
- name: Install Playwright Browsers
29+
run: npx playwright install --with-deps
4330

44-
- name: Install Playwright Browsers
45-
run: npx playwright install --with-deps
31+
- name: Create .env file
32+
run: |
33+
echo "DB_USER=postgres" >> .env
34+
echo "DB_PASSWORD=your_secure_password" >> .env
35+
echo "DB_NAME=postgres" >> .env
36+
echo "DB_PORT=5433" >> .env
37+
echo "DB_HOST=127.0.0.1" >> .env
38+
echo "POSTGRES_USER=postgres" >> .env
39+
echo "POSTGRES_PASSWORD=your_secure_password" >> .env
40+
echo "POSTGRES_DB=postgres" >> .env
4641
47-
- name: Execute Tests with DB Validation
48-
env:
49-
DB_USER: postgres
50-
DB_PASSWORD: password123
51-
DB_HOST: localhost
52-
DB_NAME: automation_db
53-
DB_PORT: 5432
54-
run: npx playwright test
42+
- name: Start Services
43+
run: docker compose up -d --build
5544

56-
- name: Generate Allure Report
57-
if: always()
58-
run: |
59-
npx allure generate allure-results --clean -o allure-report
45+
- name: Wait for Services
46+
run: sleep 30
47+
# ------------------------------------------
6048

61-
- name: Upload Allure Report Artifact
62-
if: always()
63-
uses: actions/upload-pages-artifact@v3
64-
with:
65-
path: allure-report/
49+
- name: Run Playwright tests
50+
run: npx playwright test --reporter=line,allure-playwright
51+
env:
52+
CI: true
6653

67-
deploy:
68-
needs: e2e-testing
69-
runs-on: ubuntu-latest
70-
environment:
71-
name: github-pages
72-
url: ${{ steps.deployment.outputs.page_url }}
73-
steps:
74-
- name: Deploy to GitHub Pages
75-
id: deployment
76-
uses: actions/deploy-pages@v4
54+
- name: Load test report history
55+
uses: actions/checkout@v3
56+
if: always()
57+
continue-on-error: true
58+
with:
59+
ref: gh-pages
60+
path: gh-pages
61+
62+
- name: Build test report
63+
uses: simple-elf/allure-report-action@master
64+
if: always()
65+
with:
66+
gh_pages: gh-pages
67+
allure_history: allure-history
68+
allure_results: allure-results
69+
70+
- name: Publish test report
71+
uses: peaceiris/actions-gh-pages@v3
72+
if: always()
73+
with:
74+
github_token: ${{ secrets.GITHUB_TOKEN }}
75+
publish_branch: gh-pages
76+
publish_dir: allure-history

.github/workflows/playwright.yml

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

1414
steps:
1515
- uses: actions/checkout@v4
16-
1716
- uses: actions/setup-node@v4
1817
with:
1918
node-version: 18
@@ -40,9 +39,7 @@ jobs:
4039

4140
- name: Wait for Services
4241
run: sleep 30
43-
44-
- name: Check Running Containers
45-
run: docker ps -a
42+
# ---------------------------
4643

4744
- name: Run Playwright tests
4845
run: npx playwright test

0 commit comments

Comments
 (0)