HTML Report Generate 4 #105
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
name: Run Playwright Tests for Chromium and Publish Report to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
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: Run Playwright tests for Chromium | |
run: npx playwright test --project=chromium --workers=4 | |
- name: Generate HTML Report | |
run: mv playwright-report /tmp/playwright-report | |
- name: Set up GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
folder: /tmp/playwright-report | |
- name: Commit HTML report to gh-pages | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git checkout -b gh-pages | |
cp -r /tmp/playwright-report/* ./ | |
git add . | |
git commit -m "Publish Playwright HTML report" | |
git push --force origin gh-pages |