Me 18059 esm tests over preview build #122
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: Video Player PR | |
on: | |
workflow_dispatch: | |
pull_request: | |
env: | |
CI: true | |
jobs: | |
e2e: | |
name: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: NPM Install | |
run: npm install | |
- name: Extract PR Number | |
id: extract_pr_number | |
run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
- name: Set Deploy Preview URL | |
run: echo "PREVIEW_URL=https://deploy-preview-${{ env.PR_NUMBER }}--cld-vp-esm-pages.netlify.app" >> $GITHUB_ENV | |
- name: E2E tests | |
run: npm run test:e2e | |
env: | |
PREVIEW_URL: ${{ env.PREVIEW_URL }} | |
- name: Upload report to artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Pushes to reports repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.BOT_TOKEN }} | |
with: | |
source-directory: 'playwright-report' | |
destination-github-username: 'cloudinary' | |
destination-repository-name: 'cloudinary-video-player-reports' | |
user-email: '' | |
target-branch: main | |
target-directory: 'playwright-report_${{ github.run_id }}' | |
- name: Write URL in summary | |
run: echo "### Test results https://cloudinary.github.io/cloudinary-video-player-reports/playwright-report_${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY |