From d92ab64283e1d3d6f04dc2c9f58dc0e17f2bfed2 Mon Sep 17 00:00:00 2001 From: Micah Geisel Date: Sat, 15 Feb 2025 12:54:06 -0600 Subject: [PATCH] try splitting up the ci into one job per browser to avoid CPU saturation of the single-core runner. --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++++++++++++++----- package.json | 6 ++++-- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f872dc..31769bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - test: + test-chromium: runs-on: ubuntu-latest steps: - name: Checkout code @@ -14,10 +14,42 @@ jobs: cache: 'npm' - name: Install dependencies run: npm install - - name: Install browsers - run: npx playwright install --with-deps + - name: Install browser + run: npx playwright install --with-deps chromium + - name: Run tests + run: npm run test:chromium --fail-only + + test-firefox: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Install browser + run: npx playwright install --with-deps firefox + - name: Run tests + run: npm run test:firefox --fail-only + + test-webkit: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Install browser + run: npx playwright install --with-deps webkit - name: Run tests - run: npm run ci + run: npm run test:webkit --fail-only coverage: runs-on: ubuntu-latest @@ -31,7 +63,7 @@ jobs: - name: Install dependencies run: npm install - name: Install browsers - run: npx playwright install --with-deps + run: npx playwright install --with-deps chromium - name: Run tests run: npm run test:coverage - name: Upload coverage report diff --git a/package.json b/package.json index 0e3cdc1..e7c8be0 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,11 @@ }, "scripts": { "test": "web-test-runner", - "test:coverage": "npm run ci && node test/lib/ensure-full-coverage.js", + "test:chromium": "web-test-runner --playwright --browsers chromium", + "test:firefox": "web-test-runner --playwright --browsers firefox", + "test:webkit": "web-test-runner --playwright --browsers webkit", + "test:coverage": "npm run test:chromium && node test/lib/ensure-full-coverage.js", "test:debug": "web-test-runner --manual --open", - "ci": "web-test-runner --fail-only --playwright --browsers chromium firefox webkit", "perf": "node perf/runner.js", "amd": "(echo \"define(() => {\n\" && cat src/idiomorph.js && echo \"\nreturn Idiomorph});\") > dist/idiomorph.amd.js", "cjs": "(cat src/idiomorph.js && echo \"\nmodule.exports = Idiomorph;\") > dist/idiomorph.cjs.js",