2023-04-25 13:12:32 +00:00
|
|
|
name: DevTools CI
|
|
|
|
|
|
|
|
# Declare default permissions as read only.
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
on:
|
2023-04-25 14:12:18 +00:00
|
|
|
pull_request:
|
|
|
|
types: [labeled]
|
2023-04-25 13:12:32 +00:00
|
|
|
|
|
|
|
concurrency:
|
2023-07-04 12:17:25 +00:00
|
|
|
group: devtools-${{ github.head_ref || github.run_id }}
|
2023-04-25 13:12:32 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-puppeteer:
|
|
|
|
name: Build Puppeteer
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-25 14:12:18 +00:00
|
|
|
if: contains(github.event.label.name, 'devtools')
|
2023-04-25 13:12:32 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-06-26 09:54:28 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-04-25 13:12:32 +00:00
|
|
|
- name: Set up Node.js
|
2023-07-18 12:06:17 +00:00
|
|
|
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
2023-04-25 13:12:32 +00:00
|
|
|
with:
|
|
|
|
cache: npm
|
|
|
|
node-version: lts/*
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
- name: Build Puppeteer
|
|
|
|
run: |
|
2023-04-25 13:35:56 +00:00
|
|
|
npm run build --workspace @puppeteer/browsers
|
2023-04-25 13:12:32 +00:00
|
|
|
npm run build --workspace puppeteer-core
|
|
|
|
npm run build --workspace puppeteer
|
|
|
|
- name: Pack Puppeteer
|
|
|
|
run: |
|
2023-04-25 13:35:56 +00:00
|
|
|
npm pack --workspace @puppeteer/browsers
|
2023-04-25 13:12:32 +00:00
|
|
|
npm pack --workspace puppeteer-core
|
|
|
|
npm pack --workspace puppeteer
|
|
|
|
- name: Upload Puppeteer build
|
2023-06-02 09:52:21 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2023-04-25 13:12:32 +00:00
|
|
|
with:
|
|
|
|
name: puppeteer-build
|
|
|
|
if-no-files-found: error
|
|
|
|
path: puppeteer-*.tgz
|
|
|
|
|
|
|
|
devtools-tests:
|
|
|
|
name: DevTools tests
|
|
|
|
needs: build-puppeteer
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download Puppeteer build
|
2023-06-02 09:52:21 +00:00
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2023-04-25 13:12:32 +00:00
|
|
|
with:
|
|
|
|
name: puppeteer-build
|
|
|
|
- name: Set up Node.js
|
2023-07-18 12:06:17 +00:00
|
|
|
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
2023-04-25 13:12:32 +00:00
|
|
|
with:
|
2023-06-02 09:52:21 +00:00
|
|
|
node-version: lts/*
|
2023-04-25 13:12:32 +00:00
|
|
|
- name: Checkout depot_tools
|
|
|
|
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
|
|
- name: Add depot_tools to path
|
|
|
|
run: echo $(realpath depot_tools) >> $GITHUB_PATH
|
|
|
|
- name: Fetch devtools-frontend
|
|
|
|
run: fetch devtools-frontend
|
|
|
|
- name: Sync gclient
|
|
|
|
working-directory: devtools-frontend
|
|
|
|
run: gclient sync
|
|
|
|
- name: Install Puppeteer
|
|
|
|
working-directory: devtools-frontend
|
|
|
|
run: |
|
2023-04-25 13:20:52 +00:00
|
|
|
puppeteer_pkgs=(../puppeteer-*.tgz)
|
2023-04-25 13:12:32 +00:00
|
|
|
tar -xf ${puppeteer_pkgs[0]} --strip-components 1 -C node_modules/puppeteer
|
2023-04-25 13:35:56 +00:00
|
|
|
tar -xf ${puppeteer_pkgs[1]} --strip-components 1 -C node_modules/@puppeteer/browsers
|
|
|
|
tar -xf ${puppeteer_pkgs[2]} --strip-components 1 -C node_modules/puppeteer-core
|
2023-04-25 13:12:32 +00:00
|
|
|
- name: Generate targets
|
|
|
|
working-directory: devtools-frontend
|
|
|
|
run: gn gen out/Default --args='devtools_skip_typecheck=true'
|
|
|
|
- name: Run tests
|
|
|
|
working-directory: devtools-frontend
|
|
|
|
run: npm run auto-e2etest
|