feat: implement capabilities handling in session.new #3609
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: 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: | |
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
path: 'bidi' | |
- 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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
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: Delete the downloaded version (https://github.com/npm/cli/issues/7315) | |
working-directory: puppeteer | |
run: | | |
rm packages/puppeteer-core/node_modules/chromium-bidi -r | |
- name: Setup cache for browser binaries | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.cache/chromium-bidi | |
key: ${{ runner.os }}-browsers-${{ hashFiles('bidi/.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 |