2022-05-31 12:55:46 +00:00
|
|
|
name: ToT CI
|
|
|
|
|
2022-05-13 12:15:12 +00:00
|
|
|
# Checks Puppeteer against the latest ToT build of Chromium.
|
|
|
|
# Declare default permissions as read only.
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
on:
|
2022-05-13 12:42:20 +00:00
|
|
|
workflow_dispatch:
|
2022-05-13 12:15:12 +00:00
|
|
|
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 * * *'
|
|
|
|
|
2022-06-10 10:42:29 +00:00
|
|
|
# TODO: how to make install & build steps re-usable accross jobs.
|
|
|
|
# Currently, the install step is duplicated but should be the same for all jobs.
|
|
|
|
|
2022-05-13 12:15:12 +00:00
|
|
|
jobs:
|
2022-06-10 10:42:29 +00:00
|
|
|
linux-headless:
|
2022-05-13 12:15:12 +00:00
|
|
|
# https://github.com/actions/virtual-environments#available-environments
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node: [16]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
2022-07-29 05:50:34 +00:00
|
|
|
uses: actions/setup-node@v3.4.1
|
2022-05-13 12:15:12 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Install dependencies and build
|
|
|
|
run: |
|
|
|
|
sudo apt-get install xvfb
|
|
|
|
# Ensure both a Chromium and a Firefox binary are available.
|
|
|
|
PUPPETEER_PRODUCT=firefox npm install
|
|
|
|
npm install
|
|
|
|
ls .local-chromium .local-firefox
|
|
|
|
REV=$(node utils/check_availability.js -p linux)
|
|
|
|
echo "Installing revision $REV"
|
|
|
|
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
|
|
|
|
mv src/revisions.ts.replaced src/revisions.ts
|
|
|
|
npm run build
|
|
|
|
npm install
|
|
|
|
|
|
|
|
- name: Run unit tests in headless
|
|
|
|
uses: nick-invision/retry@v2
|
|
|
|
with:
|
2022-08-11 18:45:52 +00:00
|
|
|
command: xvfb-run --auto-servernum npm run test:chrome:headless
|
2022-05-13 12:15:12 +00:00
|
|
|
timeout_minutes: 10
|
2022-06-10 10:42:29 +00:00
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
linux-headful:
|
|
|
|
# https://github.com/actions/virtual-environments#available-environments
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node: [16]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
2022-07-29 05:50:34 +00:00
|
|
|
uses: actions/setup-node@v3.4.1
|
2022-06-10 10:42:29 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Install dependencies and build
|
|
|
|
run: |
|
|
|
|
sudo apt-get install xvfb
|
|
|
|
# Ensure both a Chromium and a Firefox binary are available.
|
|
|
|
PUPPETEER_PRODUCT=firefox npm install
|
|
|
|
npm install
|
|
|
|
ls .local-chromium .local-firefox
|
|
|
|
REV=$(node utils/check_availability.js -p linux)
|
|
|
|
echo "Installing revision $REV"
|
|
|
|
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
|
|
|
|
mv src/revisions.ts.replaced src/revisions.ts
|
|
|
|
npm run build
|
|
|
|
npm install
|
2022-05-13 12:15:12 +00:00
|
|
|
|
|
|
|
- name: Run unit tests in headful
|
|
|
|
uses: nick-invision/retry@v2
|
|
|
|
with:
|
2022-07-21 08:12:23 +00:00
|
|
|
command: xvfb-run --auto-servernum npm run test:chrome:headful
|
2022-05-13 12:15:12 +00:00
|
|
|
timeout_minutes: 10
|
2022-06-10 10:42:29 +00:00
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
linux-chrome-headless:
|
|
|
|
# https://github.com/actions/virtual-environments#available-environments
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node: [16]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
2022-07-29 05:50:34 +00:00
|
|
|
uses: actions/setup-node@v3.4.1
|
2022-06-10 10:42:29 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Install dependencies and build
|
|
|
|
run: |
|
|
|
|
sudo apt-get install xvfb
|
|
|
|
# Ensure both a Chromium and a Firefox binary are available.
|
|
|
|
PUPPETEER_PRODUCT=firefox npm install
|
|
|
|
npm install
|
|
|
|
ls .local-chromium .local-firefox
|
|
|
|
REV=$(node utils/check_availability.js -p linux)
|
|
|
|
echo "Installing revision $REV"
|
|
|
|
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
|
|
|
|
mv src/revisions.ts.replaced src/revisions.ts
|
|
|
|
npm run build
|
|
|
|
npm install
|
2022-05-13 12:15:12 +00:00
|
|
|
|
|
|
|
- name: Run unit tests in chrome headless
|
|
|
|
uses: nick-invision/retry@v2
|
|
|
|
with:
|
2022-08-11 18:45:52 +00:00
|
|
|
command: xvfb-run --auto-servernum npm run test:chrome:headless-chrome
|
2022-05-13 12:15:12 +00:00
|
|
|
timeout_minutes: 10
|
2022-06-10 10:42:29 +00:00
|
|
|
max_attempts: 3
|