I have a demo repo https://github.com/sh977218/Angular-with-Playwright to try to run playwright with Angular on GitHub's action and publish the result to GitHub Page. I'm able to achieve that, but I'd like to improve it by publish each Pull Request's playwright result to GitHub Page and they are all available at same time. Can someone guide me on how to do this? This is the github action yml file
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
jobs:
Playwright-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1.0.7
with:
path: playwright-report/
- name: Deploy Playwright result to Github Pages
id: deployment
uses: actions/deploy-pages@v1.2.4
Thanks!