Skip to content

Commit e76497f

Browse files
committed
fix: disable Chrome sandbox in CI and install chromium for PDF test
1 parent 4341bf3 commit e76497f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Verify benchmarks compile
2424
run: cargo bench --no-run
2525

26+
- name: Install Chrome
27+
run: sudo apt-get update && sudo apt-get install -y chromium-browser
28+
2629
- name: Test (HTML → PDF)
2730
run: |
2831
echo "<h1>ci</h1>" > /tmp/test.html

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ impl PdfRenderer {
6060
/// Launch a headless Chrome browser.
6161
pub fn new() -> Result<Self> {
6262
let _span = info_span!("browser_launch").entered();
63+
let sandbox = !std::env::var("CI").is_ok_and(|v| !v.is_empty());
6364
let options = LaunchOptions {
6465
headless: true,
66+
sandbox,
6567
..LaunchOptions::default()
6668
};
6769
let browser = Browser::new(options).context("failed to launch headless Chrome")?;

0 commit comments

Comments
 (0)