ci: add sharding for chrome (#11038)

This commit is contained in:
Alex Rudenko 2023-09-26 18:34:05 +02:00 committed by GitHub
parent bd6c246b18
commit f59537e405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,7 @@ jobs:
run: npm run doctest run: npm run doctest
chrome-tests: chrome-tests:
name: ${{ matrix.suite }} tests on ${{ matrix.os }} name: ${{ matrix.suite }} tests on ${{ matrix.os }} (${{ matrix.shard }})
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: check-changes needs: check-changes
if: ${{ contains(fromJSON(needs.check-changes.outputs.changes), 'puppeteer') }} if: ${{ contains(fromJSON(needs.check-changes.outputs.changes), 'puppeteer') }}
@ -151,6 +151,9 @@ jobs:
- chrome-new-headless - chrome-new-headless
- chrome-bidi - chrome-bidi
- chrome-new-headless-tab - chrome-new-headless-tab
shard:
- 1/2
- 2/2
exclude: exclude:
- os: windows-latest - os: windows-latest
suite: chrome-bidi suite: chrome-bidi
@ -195,12 +198,12 @@ jobs:
run: node tools/download_chrome_bidi.mjs ~/.cache/puppeteer/chrome-canary run: node tools/download_chrome_bidi.mjs ~/.cache/puppeteer/chrome-canary
- name: Run all tests (for non-Linux) - name: Run all tests (for non-Linux)
if: ${{ matrix.os != 'ubuntu-latest' }} if: ${{ matrix.os != 'ubuntu-latest' }}
run: npm run test -- --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json run: npm run test -- --shard '${{ matrix.shard }}' --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
env: env:
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }} PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
- name: Run all tests (for Linux) - name: Run all tests (for Linux)
if: ${{ matrix.os == 'ubuntu-latest' }} if: ${{ matrix.os == 'ubuntu-latest' }}
run: xvfb-run --auto-servernum npm run test -- --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json run: xvfb-run --auto-servernum npm run test -- --shard '${{ matrix.shard }}' --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
env: env:
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }} PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3