mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
421f6f48c7
The playwright-github-action@v1 now points to v1.4.3, so we can switch to it once again.
238 lines
7.4 KiB
YAML
238 lines
7.4 KiB
YAML
name: tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- release-*
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release-*
|
|
|
|
env:
|
|
CI: true
|
|
# Force terminal colors. @see https://www.npmjs.com/package/colors
|
|
FORCE_COLOR: 1
|
|
|
|
jobs:
|
|
test_linux:
|
|
name: ${{ matrix.os }} (${{ matrix.browser }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
os: [ubuntu-18.04, ubuntu-20.04]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 10
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: mkdir -p coredumps
|
|
# Set core dump file name pattern
|
|
- run: sudo bash -c 'echo "$(pwd -P)/coredumps/core-pid_%p.dump" > /proc/sys/kernel/core_pattern'
|
|
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
|
|
# Wrap `npm run` in a subshell to redirect STDERR to file.
|
|
# Enable core dumps in the subshell.
|
|
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000 && npm run coverage"
|
|
env:
|
|
BROWSER: ${{ matrix.browser }}
|
|
DEBUG: "pw:*,-pw:wrapped*"
|
|
DEBUG_FILE: "testrun.log"
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-${{ matrix.os }}-jest-report
|
|
path: jest-report.json
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: ${{ matrix.browser }}-${{ matrix.os }}-output
|
|
path: test/output-${{ matrix.browser }}
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-${{ matrix.os }}-testrun.log
|
|
path: testrun.log
|
|
|
|
test_mac:
|
|
name: "macOS"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 10
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: npm run jest -- --testTimeout=30000
|
|
env:
|
|
BROWSER: ${{ matrix.browser }}
|
|
DEBUG: "pw:*,-pw:wrapped*"
|
|
DEBUG_FILE: "testrun.log"
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-mac-jest-report
|
|
path: jest-report.json
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: ${{ matrix.browser }}-mac-output
|
|
path: test/output-${{ matrix.browser }}
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-mac-testrun.log
|
|
path: testrun.log
|
|
|
|
test_win:
|
|
name: "Windows"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Install Media Pack
|
|
shell: powershell
|
|
run: Install-WindowsFeature Server-Media-Foundation
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 10
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: npm run jest -- --testTimeout=30000
|
|
shell: bash
|
|
env:
|
|
BROWSER: ${{ matrix.browser }}
|
|
DEBUG: "pw:*,-pw:wrapped*"
|
|
DEBUG_FILE: "testrun.log"
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-win-jest-report
|
|
path: jest-report.json
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: ${{ matrix.browser }}-win-output
|
|
path: test/output-${{ matrix.browser }}
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: ${{ matrix.browser }}-win-testrun.log
|
|
path: testrun.log
|
|
|
|
test-package-installations:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node_version:
|
|
- "^10.17.0" # pre 10.17, --unhandled-rejections=strict was not an option (https://github.com/nodejs/node/pull/26599) which we need in our tests
|
|
- "^12.0.0"
|
|
- "^14.1.0" # pre 14.1, zip extraction was broken (https://github.com/microsoft/playwright/issues/1988)
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: bash packages/installation-tests/installation-tests.sh
|
|
|
|
headful_linux:
|
|
name: "Headful Linux"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 10
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: mkdir -p coredumps
|
|
# Set core dump file name pattern
|
|
- run: sudo bash -c 'echo "$(pwd -P)/coredumps/core-pid_%p.dump" > /proc/sys/kernel/core_pattern'
|
|
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
|
|
# Wrap `npm run` in a subshell to redirect STDERR to file.
|
|
# Enable core dumps in the subshell.
|
|
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
|
|
if: ${{ always() }}
|
|
env:
|
|
BROWSER: ${{ matrix.browser }}
|
|
HEADLESS: "false"
|
|
DEBUG_FILE: "testrun.log"
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: headful-${{ matrix.browser }}-linux-jest-report
|
|
path: jest-report.json
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: headful-${{ matrix.browser }}-linux-testrun.log
|
|
path: testrun.log
|
|
|
|
rpc_linux:
|
|
name: "RPC Linux"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
transport: [wire, object]
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 10
|
|
- uses: microsoft/playwright-github-action@v1
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: mkdir -p coredumps
|
|
# Set core dump file name pattern
|
|
- run: sudo bash -c 'echo "$(pwd -P)/coredumps/core-pid_%p.dump" > /proc/sys/kernel/core_pattern'
|
|
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
|
|
# Wrap `npm run` in a subshell to redirect STDERR to file.
|
|
# Enable core dumps in the subshell.
|
|
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
|
|
env:
|
|
BROWSER: ${{ matrix.browser }}
|
|
DEBUG: "pw:*,-pw:wrapped*"
|
|
DEBUG_FILE: "testrun.log"
|
|
PWCHANNEL: ${{ matrix.transport }}
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-jest-report
|
|
path: jest-report.json
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-output
|
|
path: test/output-${{ matrix.browser }}
|
|
- uses: actions/upload-artifact@v1
|
|
if: ${{ always() }}
|
|
with:
|
|
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-testrun.log
|
|
path: testrun.log
|