Video Player PR #32
Workflow file for this run
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: | |
env: | |
CI: true | |
jobs: | |
e2e: | |
name: install | |
runs-on: large-github-runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Node setup | |
uses: ./.github/actions/node-setup | |
- name: NPM Install | |
run: npm install | |
- name: E2E tests | |
run: npm run test:e2e | |
- name: Upload report to artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Publish report to dedicated repo | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
# Define the unique folder name using run ID and PR number (if available) | |
UNIQUE_FOLDER_NAME="report-${{ github.run_id }}-pr-${{ github.event.pull_request.number || 'no-pr' }}" | |
# Create a separate directory in the system's temporary directory | |
TMP_DIR=$(mktemp -d) | |
REPORT_DIR="$TMP_DIR/$UNIQUE_FOLDER_NAME" | |
mkdir -p $REPORT_DIR | |
# Clone the dedicated repo into the new directory | |
git clone [email protected]:cloudinary/cloudinary-video-player-reports.git $REPORT_DIR | |
# Copy the report files to the cloned repo | |
cp -r playwright-report/* $REPORT_DIR/ | |
# Navigate to the cloned repo directory | |
cd $REPORT_DIR | |
git checkout -B test_branch origin/test_branch | |
# Commit and push the report | |
git add . | |
git commit -m "Update report for run ${{ github.run_id }} and PR ${{ github.event.pull_request.number || 'no-pr' }}" | |
git push origin test_branch | |