ci: fix linux builds

This commit is contained in:
sebthom
2024-12-12 22:09:57 +01:00
parent 9a826452f9
commit ab953111d4

View File

@@ -3,7 +3,8 @@ SPDX-FileCopyrightText: © Sebastian Thomschke and contributors
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-ArtifactOfProjectHomePage: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/ SPDX-ArtifactOfProjectHomePage: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/
""" """
import logging, os import logging, os, platform
from typing import cast
import nodriver, pytest import nodriver, pytest
@@ -17,6 +18,9 @@ if os.environ.get("CI"):
async def atest_init() -> None: async def atest_init() -> None:
web_scraping_mixin = WebScrapingMixin() web_scraping_mixin = WebScrapingMixin()
if platform.system() == "Linux":
# required for Ubuntu 24.04 or newer
cast(list[str], web_scraping_mixin.browser_config.arguments).append("--no-sandbox")
browser_path = web_scraping_mixin.get_compatible_browser() browser_path = web_scraping_mixin.get_compatible_browser()
ensure(browser_path is not None, "Browser not auto-detected") ensure(browser_path is not None, "Browser not auto-detected")