Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 53 additions & 47 deletions .github/workflows/e2e_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,66 @@ jobs:
name: install
runs-on: ubuntu-latest
steps:
- name: Set timestamp
id: timestamp
run: echo "TIMESTAMP=$(date +%Y%m%d_%H%M%S_%3N)" >> $GITHUB_ENV
- name: echo secrets
run: echo "$GARAME_TEST" | base64
env:
GARAME_TEST: ${{ secrets.GARAME_TEST }}
# env:
# API_TOKEN_GITHUB: ${{ secrets.BOT_TOKEN }}
# - name: Set timestamp
# id: timestamp
# run: echo "TIMESTAMP=$(date +%Y%m%d_%H%M%S_%3N)" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# - name: Checkout
# uses: actions/checkout@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version-file: '.nvmrc'
# registry-url: 'https://registry.npmjs.org'

- name: NPM Install
run: npm install
# - 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: 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: Set Deploy Preview URL
# run: echo "PREVIEW_URL=https://deploy-preview-${{ env.PR_NUMBER }}--cld-vp-esm-pages.netlify.app" >> $GITHUB_ENV

- name: Install Playwright Browsers
run: npx playwright install --with-deps
# - name: Install Playwright Browsers
# run: npx playwright install --with-deps

- name: E2E tests
run: npm run test:e2e
env:
PREVIEW_URL: ${{ env.PREVIEW_URL }}
# - 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: 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
if: always()
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_ts_${{ env.TIMESTAMP }}'
# - name: Pushes to reports repository
# if: always()
# 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_ts_${{ env.TIMESTAMP }}'

- name: Write URL in summary
if: always()
run: echo "### Test results https://cloudinary.github.io/cloudinary-video-player-reports/playwright-report_ts_${{ env.TIMESTAMP }}" >> $GITHUB_STEP_SUMMARY
# - name: Write URL in summary
# if: always()
# run: echo "### Test results https://cloudinary.github.io/cloudinary-video-player-reports/playwright-report_ts_${{ env.TIMESTAMP }}" >> $GITHUB_STEP_SUMMARY