2024-01-02 13:29:26 +00:00
|
|
|
name: Puppeteer Canary CI
|
|
|
|
|
|
|
|
# Declare default permissions as read only.
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# Run everyday at: https://crontab.guru/#0_8_*_*_*.
|
|
|
|
- cron: '0 8 * * *'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
canary-chrome-tests:
|
2024-04-05 09:05:39 +00:00
|
|
|
name: ${{ matrix.suite }} tests on ${{ matrix.os }} (${{ matrix.shard }}) ${{ matrix.configs }}
|
2024-01-02 13:29:26 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
suite:
|
|
|
|
- chrome-headless
|
|
|
|
- chrome-headful
|
2024-02-02 12:25:43 +00:00
|
|
|
- chrome-headless-shell
|
2024-01-02 13:29:26 +00:00
|
|
|
- chrome-bidi
|
2024-01-15 09:49:13 +00:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
2024-04-25 10:02:30 +00:00
|
|
|
- macos-13
|
2024-01-02 13:29:26 +00:00
|
|
|
shard:
|
|
|
|
- 1-2
|
|
|
|
- 2-2
|
2024-04-05 09:05:39 +00:00
|
|
|
configs:
|
|
|
|
- experimental
|
|
|
|
- stable
|
2024-01-02 13:29:26 +00:00
|
|
|
exclude:
|
|
|
|
- os: windows-latest
|
|
|
|
suite: chrome-bidi
|
2024-04-25 10:02:30 +00:00
|
|
|
- os: macos-13
|
2024-01-02 13:29:26 +00:00
|
|
|
suite: chrome-headful
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
2024-05-21 08:14:13 +00:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2024-01-02 13:29:26 +00:00
|
|
|
- name: Set up Node.js
|
2024-02-12 09:49:18 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2024-01-02 13:29:26 +00:00
|
|
|
with:
|
|
|
|
cache: npm
|
2024-01-24 10:27:35 +00:00
|
|
|
node-version-file: '.nvmrc'
|
2024-01-02 13:29:26 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
# Set up GitHub Actions caching for Wireit.
|
2024-02-21 09:37:35 +00:00
|
|
|
- uses: google/wireit@4aad131006ea85c1e42af927534ebb13426dd730 # setup-github-actions-caching/v1.0.2
|
2024-01-02 13:29:26 +00:00
|
|
|
- name: Build packages
|
|
|
|
run: npm run build --workspace @puppeteer-test/test
|
|
|
|
- name: Install Chrome Canary
|
|
|
|
id: browser
|
2024-02-14 18:07:13 +00:00
|
|
|
run: node tools/download_chrome_canary.mjs $HOME/.cache/puppeteer/chrome-canary
|
2024-05-15 09:03:55 +00:00
|
|
|
- name: Configure permissions
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
run: icacls $HOME/.cache/puppeteer/chrome-canary /grant "ALL APPLICATION PACKAGES:(OI)(CI)(RX)"
|
2024-05-03 08:31:21 +00:00
|
|
|
- name: Apply Canary expectations
|
|
|
|
run: node tools/merge-canary-test-expectations.mjs
|
2024-01-02 13:29:26 +00:00
|
|
|
- name: Run all tests (for non-Linux)
|
|
|
|
if: ${{ matrix.os != 'ubuntu-latest' }}
|
|
|
|
run: npm run test -- --shard '${{ matrix.shard }}' --test-suite ${{ matrix.suite }} --save-stats-to /tmp/artifacts/${{ github.event_name }}_INSERTID.json
|
|
|
|
env:
|
|
|
|
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
|
2024-04-05 09:05:39 +00:00
|
|
|
PUPPETEER_TEST_EXPERIMENTAL_CHROME_FEATURES: ${{ matrix.configs == 'experimental' }}
|
2024-01-02 13:29:26 +00:00
|
|
|
- name: Run all tests (for Linux)
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
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:
|
|
|
|
PUPPETEER_EXECUTABLE_PATH: ${{ steps.browser.outputs.executablePath }}
|
2024-04-05 09:05:39 +00:00
|
|
|
PUPPETEER_TEST_EXPERIMENTAL_CHROME_FEATURES: ${{ matrix.configs == 'experimental' }}
|
2024-04-29 08:53:29 +00:00
|
|
|
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
2024-01-02 13:29:26 +00:00
|
|
|
if: always()
|
|
|
|
with:
|
2024-04-05 09:05:39 +00:00
|
|
|
name: test-results-${{ matrix.os }}-${{ matrix.suite }}-${{ matrix.shard }}-${{ matrix.configs }}
|
2024-01-02 13:29:26 +00:00
|
|
|
path: /tmp/artifacts/*.json
|
2024-05-02 12:16:15 +00:00
|
|
|
|
|
|
|
report-results:
|
|
|
|
name: 'Report results'
|
|
|
|
needs: [canary-chrome-tests]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
issues: write
|
|
|
|
if: ${{ always() }}
|
|
|
|
steps:
|
|
|
|
- name: Post comment
|
|
|
|
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
|
|
|
if: ${{ needs.canary-chrome-tests.result != 'success'}}
|
|
|
|
with:
|
|
|
|
# https://github.com/puppeteer/puppeteer/issues/12379
|
|
|
|
issue-number: 12379
|
|
|
|
body: |
|
2024-05-07 07:59:46 +00:00
|
|
|
❌ Tests with Chrome Canary failed
|
|
|
|
|
|
|
|
---
|
|
|
|
[Link](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
|
|
- name: Post comment
|
|
|
|
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
|
|
|
if: ${{ needs.canary-chrome-tests.result == 'success'}}
|
|
|
|
with:
|
|
|
|
# https://github.com/puppeteer/puppeteer/issues/12379
|
|
|
|
issue-number: 12379
|
|
|
|
body: |
|
|
|
|
✅ Tests with Chrome Canary succeeded
|
2024-05-02 12:16:15 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
[Link](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|