forked from puppeteer/puppeteer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: run different ToT jobs in parallel (puppeteer#8502)
- Loading branch information
Showing
1 changed file
with
69 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,11 @@ on: | |
# Supposed to be every day at 8 am (UTC). | ||
- cron: '0 8 * * *' | ||
|
||
# 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. | ||
|
||
jobs: | ||
linux: | ||
linux-headless: | ||
# https://github.com/actions/virtual-environments#available-environments | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -49,27 +52,87 @@ jobs: | |
CHROMIUM: true | ||
HEADLESS: true | ||
with: | ||
max_attempts: 3 | ||
command: xvfb-run --auto-servernum npm run test:unit | ||
timeout_minutes: 10 | ||
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 | ||
uses: actions/[email protected] | ||
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 headful | ||
uses: nick-invision/retry@v2 | ||
continue-on-error: true | ||
env: | ||
CHROMIUM: true | ||
HEADLESS: false | ||
with: | ||
max_attempts: 3 | ||
command: xvfb-run --auto-servernum npm run test:unit | ||
timeout_minutes: 10 | ||
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 | ||
uses: actions/[email protected] | ||
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 chrome headless | ||
uses: nick-invision/retry@v2 | ||
continue-on-error: true | ||
env: | ||
CHROMIUM: true | ||
with: | ||
max_attempts: 3 | ||
command: xvfb-run --auto-servernum npm run test:unit:chrome-headless | ||
timeout_minutes: 10 | ||
max_attempts: 3 |