devops: use matrix in GHA, add non-linux rpc (#2907)

This commit is contained in:
Pavel Feldman 2020-07-10 13:15:57 -07:00 committed by GitHub
parent c89c30e333
commit d561465214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 207 deletions

View File

@ -16,8 +16,12 @@ env:
FORCE_COLOR: 1
jobs:
chromium_linux:
name: "Chromium Linux"
test_linux:
name: "Linux"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
@ -33,27 +37,32 @@ jobs:
# 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 ccoverage 2>./chromium-linux-testrun.log"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run coverage 2>./${{ matrix.browser }}-linux-testrun.log"
env:
DEBUG: "*"
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-linux-output
path: test/output-chromium
name: ${{ matrix.browser }}-linux-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-linux-testrun.log
path: chromium-linux-testrun.log
name: ${{ matrix.browser }}-linux-testrun.log
path: ${{ matrix.browser }}-linux-testrun.log
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-linux-coredumps
name: ${{ matrix.browser }}-linux-coredumps
path: coredumps
chromium_mac:
name: "Chromium Mac"
test_mac:
name: "macOS"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
@ -63,22 +72,27 @@ jobs:
- uses: microsoft/playwright-github-action@v1
- run: npm ci
- run: npm run build
- run: npm run ctest 2>./chromium-mac-testrun.log
- run: npm run test 2>./${{ matrix.browser }}-mac-testrun.log
env:
DEBUG: "*"
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-mac-output
path: test/output-chromium
name: ${{ matrix.browser }}-mac-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-mac-testrun.log
path: chromium-mac-testrun.log
name: ${{ matrix.browser }}-mac-testrun.log
path: ${{ matrix.browser }}-mac-testrun.log
chromium_win:
name: "Chromium Win"
test_win:
name: "Windows"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
@ -88,194 +102,21 @@ jobs:
- uses: microsoft/playwright-github-action@v1
- run: npm ci
- run: npm run build
- run: npm run ctest 2>./chromium-win-testrun.log
- run: npm run test 2>./${{ matrix.browser }}-win-testrun.log
shell: bash
env:
DEBUG: "*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-win-output
path: test/output-chromium
- uses: actions/upload-artifact@v1
if: failure()
with:
name: chromium-win-testrun.log
path: chromium-win-testrun.log
webkit_linux:
name: "WebKit 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'
# 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 wcoverage 2>./webkit-linux-testrun.log"
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-linux-output
path: test/output-webkit
name: ${{ matrix.browser }}-win-output
path: test/output-${{ matrix.browser }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-linux-testrun.log
path: webkit-linux-testrun.log
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-linux-coredumps
path: coredumps
webkit_mac:
name: "WebKit Mac"
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 wtest 2>./webkit-mac-testrun.log
env:
DEBUG: "*,-pw:wrapped*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-mac-output
path: test/output-webkit
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-mac-testrun.log
path: webkit-mac-testrun.log
webkit_win:
name: "WebKit Win"
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 wtest 2>./webkit-win-testrun.log
shell: bash
env:
DEBUG: "*,-pw:wrapped*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-win-output
path: test/output-webkit
- uses: actions/upload-artifact@v1
if: failure()
with:
name: webkit-win-testrun.log
path: webkit-win-testrun.log
firefox_linux:
name: "Firefox 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'
# 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 fcoverage 2>./firefox-linux-testrun.log"
env:
DEBUG: "*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-linux-output
path: test/output-firefox
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-linux-testrun.log
path: firefox-linux-testrun.log
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-linux-coredumps
path: coredumps
firefox_mac:
name: "Firefox Mac"
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 ftest 2>./firefox-mac-testrun.log
env:
DEBUG: "*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-mac-output
path: test/output-firefox
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-mac-testrun.log
path: firefox-mac-testrun.log
firefox_win:
name: "Firefox Win"
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 ftest 2>./firefox-win-testrun.log
shell: bash
env:
DEBUG: "*"
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-win-output
path: test/output-firefox
- uses: actions/upload-artifact@v1
if: failure()
with:
name: firefox-win-testrun.log
path: firefox-win-testrun.log
name: ${{ matrix.browser }}-win-testrun.log
path: ${{ matrix.browser }}-win-testrun.log
test-package-installations:
runs-on: ubuntu-latest
@ -327,8 +168,12 @@ jobs:
name: headful-linux-coredumps
path: coredumps
channel_linux:
name: "Channel Chromium Linux"
rpc_linux:
name: "RPC Linux"
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
@ -344,12 +189,13 @@ jobs:
# 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 ctest 2>./channel-linux-testrun.log"
- run: xvfb-run --auto-servernum -- bash -c "ulimit -c unlimited && npm run test 2>./channel-linux-testrun.log"
env:
DEBUG: "*"
BROWSER: ${{ matrix.browser }}
DEBUG: "*,-pw:wrapped*"
PWCHANNEL: "1"
# Ensure output folder exists just in case it was not created by the test run.
- run: node -e "require('fs').mkdirSync(require('path').join('test', 'output-chromium'), {recursive:true})"
- run: node -e "require('fs').mkdirSync(require('path').join('test', 'output-${{ matrix.browser }}'), {recursive:true})"
if: failure()
- uses: actions/upload-artifact@v1
if: failure()

View File

@ -15,15 +15,15 @@
"ctest": "cross-env BROWSER=chromium node --unhandled-rejections=strict test/test.js",
"ftest": "cross-env BROWSER=firefox node --unhandled-rejections=strict test/test.js",
"wtest": "cross-env BROWSER=webkit node --unhandled-rejections=strict test/test.js",
"test": "cross-env BROWSER=all node --unhandled-rejections=strict test/test.js",
"test": "cross-env node --unhandled-rejections=strict test/test.js",
"cunit": "cross-env BROWSER=chromium node --unhandled-rejections=strict test/test.js",
"funit": "cross-env BROWSER=firefox node --unhandled-rejections=strict test/test.js",
"wunit": "cross-env BROWSER=webkit node --unhandled-rejections=strict test/test.js",
"unit": "cross-env BROWSER=all node --unhandled-rejections=strict test/test.js",
"unit": "cross-env node --unhandled-rejections=strict test/test.js",
"ccoverage": "cross-env COVERAGE=true BROWSER=chromium node --unhandled-rejections=strict test/test.js",
"fcoverage": "cross-env COVERAGE=true BROWSER=firefox node --unhandled-rejections=strict test/test.js",
"wcoverage": "cross-env COVERAGE=true BROWSER=webkit node --unhandled-rejections=strict test/test.js",
"coverage": "cross-env COVERAGE=true BROWSER=all node --unhandled-rejections=strict test/test.js",
"coverage": "cross-env COVERAGE=true node --unhandled-rejections=strict test/test.js",
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts ./src || eslint --ext js,ts ./src",
"tsc": "tsc -p .",
"tsc-installer": "tsc -p ./src/install/tsconfig.json",

View File

@ -171,7 +171,7 @@ module.exports = collect;
if (require.main === module) {
console.log('Testing on Node', process.version);
const browserNames = ['chromium', 'firefox', 'webkit'].filter(name => {
return process.env.BROWSER === name || process.env.BROWSER === 'all';
return process.env.BROWSER === name || !process.env.BROWSER;
});
const testRunner = collect(browserNames);