playwright/.github/workflows/tests.yml

246 lines
7.7 KiB
YAML
Raw Normal View History

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: "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 test 2>./testrun.log"
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
if: ${{ always() }}
env:
BROWSER: ${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-linux-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-linux-testrun.log
path: testrun.log
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-linux-coredumps
path: coredumps
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 test 2>./${{ matrix.browser }}-mac-testrun.log
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- run: npm run jest -- --testTimeout=30000
if: ${{ always() }}
env:
BROWSER: ${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-mac-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-mac-testrun.log
path: ${{ matrix.browser }}-mac-testrun.log
test_win:
name: "Windows"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: windows-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 test 2>./${{ matrix.browser }}-win-testrun.log
shell: bash
2020-02-14 04:48:45 +03:00
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- run: npm run jest -- --testTimeout=30000
if: ${{ always() }}
shell: bash
env:
BROWSER: ${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-win-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.browser }}-win-testrun.log
path: ${{ matrix.browser }}-win-testrun.log
test-package-installations:
runs-on: ubuntu-latest
strategy:
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
2020-05-05 01:15:51 +03:00
headful_linux:
name: "Headful Linux"
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'
2020-05-05 01:15:51 +03:00
# 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.
2020-07-01 04:51:36 +03:00
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run test -- --line-break=100 2>./headful-linux-testrun.log"
2020-05-05 01:15:51 +03:00
env:
DEBUG: "*"
2020-07-01 04:51:36 +03:00
HEADLESS: "false"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
if: ${{ always() }}
env:
BROWSER: "chromium"
HEADLESS: "false"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
if: ${{ always() }}
env:
BROWSER: "firefox"
HEADLESS: "false"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
if: ${{ always() }}
env:
BROWSER: "webkit"
HEADLESS: "false"
2020-05-05 01:15:51 +03:00
- uses: actions/upload-artifact@v1
if: failure()
with:
name: headful-linux-testrun.log
path: headful-linux-testrun.log
- uses: actions/upload-artifact@v1
if: failure()
with:
name: headful-linux-coredumps
path: coredumps
2020-07-01 04:51:36 +03:00
rpc_linux:
name: "RPC Linux"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
transport: [wire, object]
2020-07-01 04:51:36 +03:00
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
2020-07-01 04:51:36 +03:00
- 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 test 2>./testrun.log"
2020-07-01 04:51:36 +03:00
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
PWCHANNEL: ${{ matrix.transport }}
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run jest -- --testTimeout=30000"
if: ${{ always() }}
env:
BROWSER: ${{ matrix.browser }}
PWCHANNEL: ${{ matrix.transport }}
2020-07-01 04:51:36 +03:00
- uses: actions/upload-artifact@v1
if: failure()
with:
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-output
path: test/output-${{ matrix.browser }}
2020-07-01 04:51:36 +03:00
- uses: actions/upload-artifact@v1
if: failure()
with:
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-testrun.log
path: testrun.log
2020-07-01 04:51:36 +03:00
- uses: actions/upload-artifact@v1
if: failure()
with:
name: rpc-${{ matrix.transport }}-${{ matrix.browser }}-linux-coredumps
2020-07-01 04:51:36 +03:00
path: coredumps