Skip to content

Commit

Permalink
Configure Chrome's sandbox settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadJaziraly committed Dec 26, 2024
1 parent 80f8f7d commit 0de1996
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ jobs:
with:
chrome-version: stable

- name: Configure Chrome Sandbox
run: |
sudo chown root:root /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
sudo chmod 4755 /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
- name: Install dependencies
run: npm install

- name: Run ESLint and tests
run: npm test
env:
CHROME_BIN: chrome
CHROME_BIN: chrome
CHROME_FLAGS: --no-sandbox --headless --disable-gpu
14 changes: 13 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ module.exports = function ( config ) {
port: 9876,

logLevel: config.LOG_INFO,
browsers: [ 'ChromeHeadless' ]
browsers: [ 'ChromeHeadless' ],
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-software-rasterizer'
]
}
},

Check failure on line 46 in karma.conf.js

View workflow job for this annotation

GitHub Actions / test (10)

Unexpected trailing comma

Check failure on line 46 in karma.conf.js

View workflow job for this annotation

GitHub Actions / test (12)

Unexpected trailing comma

Check failure on line 46 in karma.conf.js

View workflow job for this annotation

GitHub Actions / test (14)

Unexpected trailing comma
} );
};

0 comments on commit 0de1996

Please sign in to comment.