Skip to content

Commit cb45f72

Browse files
authored
Merge branch 'main' into kh-add-webp-support
2 parents 25563c6 + 2693c2d commit cb45f72

File tree

4 files changed

+2974
-1540
lines changed

4 files changed

+2974
-1540
lines changed

.github/workflows/nodejs.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ on: [push]
33
jobs:
44
build:
55
runs-on: ubuntu-latest
6+
permissions:
7+
contents: read
68
steps:
7-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
810
- name: Use Node.js
9-
uses: actions/setup-node@v1
11+
uses: actions/setup-node@v4
1012
with:
11-
node-version: '14.x'
13+
node-version: '20.x'
14+
# Enable unprivileged user namespaces for Chrome sandbox
15+
# This is required because Ubuntu 23.10+ disables them by default
16+
# See: https://github.com/actions/runner-images/issues/9621
17+
- name: Enable user namespaces
18+
run: sudo sysctl -w kernel.unprivileged_userns_clone=1
1219
- run: npm install
1320
- run: npm run build --if-present
1421
- run: npm test

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
publish-npm:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
1012
steps:
1113
- uses: actions/checkout@v3
1214
- uses: actions/setup-node@v3

karma.config.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
process.env.CHROME_BIN = require('chromium').path
1+
// Use system Chrome/Chromium if available, otherwise let Karma find it
2+
// In CI environments, CHROME_BIN should be set or the system Chrome should be in PATH
3+
if (!process.env.CHROME_BIN) {
4+
try {
5+
const chromiumPath = require('chromium').path
6+
if (chromiumPath) {
7+
process.env.CHROME_BIN = chromiumPath
8+
}
9+
} catch (e) {
10+
// If chromium package doesn't work, let Karma use system Chrome
11+
}
12+
}
213

314
module.exports = function (config) {
415
config.set({
@@ -11,7 +22,17 @@ module.exports = function (config) {
1122
port: 9876,
1223
colors: true,
1324
logLevel: config.LOG_INFO,
14-
browsers: ['ChromeHeadless'],
25+
browsers: ['ChromeHeadlessCI'],
26+
customLaunchers: {
27+
ChromeHeadlessCI: {
28+
base: 'ChromeHeadless',
29+
flags: [
30+
'--no-sandbox',
31+
'--disable-gpu',
32+
'--disable-dev-shm-usage'
33+
]
34+
}
35+
},
1536
autoWatch: false,
1637
singleRun: true,
1738
concurrency: Infinity

0 commit comments

Comments
 (0)