From e792bfc554c938e86927a317fef1c824d640b3bf Mon Sep 17 00:00:00 2001 From: Layue13 Date: Sun, 8 Nov 2026 16:21:40 +0800 Subject: [PATCH] ci: try installing xvfb before refreshing the package index Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/gradle.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index d31eda06ac..76c24e7d5c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,8 +46,10 @@ jobs: key: gradle-dist-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'gradle/wrapper/GradleWrapperNeo.java') }} - name: Install Xvfb run: | - # Skip the slow apt update when the runner image already has it. - command -v xvfb-run >/dev/null || { sudo apt-get update && sudo apt-get install -y xvfb; } + # Installing is the slowest setup step, so skip it when the runner already has xvfb, and + # only refresh the package index when a plain install fails. + command -v xvfb-run >/dev/null || sudo apt-get install -y --no-install-recommends xvfb \ + || { sudo apt-get update && sudo apt-get install -y --no-install-recommends xvfb; } # One Gradle run builds, tests and runs the code and translation checks, so the # project is configured and compiled once instead of in two workflows. - name: Build and check with Gradle