Skip to content

test cicd

test cicd #118

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: '0 0 * * *' # 6 AM GMT+6 (0 0 in UTC)
permissions:
contents: write # Grants write access to the repository
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Install Playwright browsers
run: npx playwright install
- name: Set up environment variables
run: |
echo "SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }}" >> .env
- name: Run Playwright tests for Chromium
run: npx playwright test --project=chromium --workers=4
continue-on-error: true # Ensures workflow continues even if tests fail
# - name: Move HTML Report
# run: mv playwright-report /tmp/playwright-report
# continue-on-error: true # Ensures workflow continues even if tests fail
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Deploy HTML report to GitHub Pages (https://nahidthenh.github.io/embedpress-playwright-automation/)
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
publish_branch: gh-pages
publish_dir: ./playwright-report
keep_files: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'