Skip to content

docs: fix script

docs: fix script #1329

Workflow file for this run

name: Puppeteer CI
# Declare default permissions as read only.
permissions: read-all
on:
pull_request:
types:
# These are the defaults. See
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- opened
- reopened
- synchronize
# Used for `puppeteer`
- labeled
workflow_dispatch:
concurrency:
group: puppeteer-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
add-label-to-release:
name: Add label to release
runs-on: ubuntu-latest
if: contains(github.head_ref, 'release-please')
permissions:
pull-requests: write
steps:
- run: gh pr edit "$NUMBER" --add-label "puppeteer"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
puppeteer-test:
name: Run Puppeteer tests
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'puppeteer')
steps:
- name: Checkout Chromium-BiDi
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: 'bidi'
- name: Set up FFmpeg
uses: FedericoCarboni/setup-ffmpeg@36c6454b5a2348e7794ba2d82a21506605921e3d # v3.0.0
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: './bidi/.nvmrc'
- name: Install Chromium-BiDi dependencies
working-directory: bidi
run: npm ci
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Build Chromium-BiDi
working-directory: bidi
run: |
npm run build
- name: Link Chromium-BiDi
working-directory: bidi
run: npm link
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: 'puppeteer/puppeteer'
path: 'puppeteer'
- name: Install Puppeteer dependencies
working-directory: puppeteer
run: npm ci
# We need to build Puppeteer first to not hit devtools protocol dep issue
- name: Build Puppeteer
working-directory: puppeteer
run: npm run build
- name: Install Chromium-BiDi
working-directory: puppeteer
run: |
npm link chromium-bidi -w puppeteer-core
- name: Setup cache for browser binaries
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ~/.cache/chromium-bidi
key: ${{ runner.os }}-browsers-${{ hashFiles('.browser') }}) }}
- name: Install pinned browser
id: browser
working-directory: bidi
run: node tools/install-browser.mjs --github
- name: Run tests
working-directory: puppeteer
env:
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
run: xvfb-run --auto-servernum npm run test:chrome:bidi