Skip to content

Commit

Permalink
try splitting up the ci into one job per browser to avoid CPU saturat…
Browse files Browse the repository at this point in the history
…ion of the single-core runner.
  • Loading branch information
botandrose-machine committed Feb 15, 2025
1 parent 1d85b04 commit d92ab64
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [push, pull_request]

jobs:
test:
test-chromium:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d92ab64

Please sign in to comment.