puppeteer/.github/workflows/tot-ci.yml
2023-03-10 08:52:48 +01:00

55 lines
1.8 KiB
YAML

name: ToT CI
# Checks Puppeteer against the latest ToT build of Chromium.
# Declare default permissions as read only.
permissions: read-all
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
# Supposed to be every day at 8 am (UTC).
- cron: '0 8 * * *'
# TODO: how to make install & build steps re-usable across jobs.
# Currently, the install step is duplicated but should be the same for all jobs.
jobs:
ci:
name: ${{ matrix.suite }} tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- chrome-headless
- chrome-headful
- chrome-new-headless
steps:
- name: Check out repository
uses: actions/checkout@v3.0.2
- name: Set up Node.js
uses: actions/setup-node@v3.5.1
with:
cache: npm
node-version: latest
- name: Install dependencies
run: npm ci
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Install linux dependencies.
run: sudo apt-get install xvfb
- name: Build packages
run: npm run build
- name: Get latest revision
run: |
REV=$(node tools/check_availability.js -p linux)
cat packages/puppeteer-core/src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > packages/puppeteer-core/src/revisions.ts.replaced
mv packages/puppeteer-core/src/revisions.ts.replaced packages/puppeteer-core/src/revisions.ts
- name: Rebuild `puppeteer-core`
run: npm run build --workspace puppeteer-core
- name: Install Chrome
run: npm run postinstall --workspace puppeteer
- name: Run tests
run: xvfb-run --auto-servernum npm run test -- --test-suite ${{ matrix.suite }}