mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
ci: reuse the headless-chrome action in the browser job
Same three steps the examples workflow needs, and the comment explaining the AppArmor sysctl now lives in one place.
This commit is contained in:
1 parent
52ee0ad424
commit
c70d36d18d
1 file changed
+2
-21
@@ -119,27 +119,8 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
# Pin stable: a dev Chromium's remote-debugging socket is flaky under
|
||||
# the driver, even though the browser otherwise launches headless.
|
||||
- name: Set up Chrome
|
||||
uses: browser-actions/setup-chrome@v2
|
||||
with:
|
||||
chrome-version: stable
|
||||
|
||||
# Ubuntu 24.04 (current ubuntu-latest) restricts unprivileged user
|
||||
# namespaces via AppArmor, which stops headless Chrome from starting even
|
||||
# with --no-sandbox: the process launches but never opens its DevTools
|
||||
# socket. Re-enable them so the driver's Chrome can come up.
|
||||
- name: Allow Chrome under unprivileged user namespaces
|
||||
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
|
||||
# Fail here with Chrome's own stderr if the browser can't launch, instead
|
||||
# of letting the driver report an opaque DevTools timeout downstream.
|
||||
- name: Verify headless Chrome starts
|
||||
run: |
|
||||
chrome --version
|
||||
chrome --headless --no-sandbox --disable-gpu --disable-dev-shm-usage \
|
||||
--dump-dom 'data:text/html,<title>ok</title>'
|
||||
- name: Set up headless Chrome
|
||||
uses: ./.github/actions/headless-chrome
|
||||
|
||||
- name: Drive web fixtures through headless Chrome
|
||||
run: make test-browser
|
||||
Reference in new issue
Block a user