Skip to content

added yml and Allure report #1

added yml and Allure report

added yml and Allure report #1

name: Playwright API Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm test
continue-on-error: true
- name: Generate Allure Report
if: always()
run: |
npm run allure:generate
- name: Upload Allure Results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results
path: allure-results/
retention-days: 30
- name: Upload Allure Report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-report
path: allure-report/
retention-days: 30
- name: Upload Playwright Report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Deploy Allure Report to GitHub Pages
if: always() && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-report
keep_files: false
- name: Add Allure Report Link to Summary
if: always()
run: |
echo "## Test Results 📊" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Tests completed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📁 Allure Report: Download the 'allure-report' artifact to view detailed results" >> $GITHUB_STEP_SUMMARY
echo "📁 Playwright Report: Download the 'playwright-report' artifact" >> $GITHUB_STEP_SUMMARY