From cce3a7b159e30e07e461b1d643e76447c8bacde4 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Sat, 21 Nov 2026 19:29:59 -0800 Subject: [PATCH] Skip APT when native xDR build prerequisites are installed An index refresh can consume the native coverage job before the build starts. Check the native package states first and use the existing APT setup when a prerequisite is missing or needs repair. Signed-off-by: Trent Nelson --- .github/workflows/coverage.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 58cb13b9..d6d0c956 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -190,10 +190,20 @@ jobs: git rev-parse HEAD nvidia-smi - name: Install native build prerequisites + shell: bash run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - build-essential pkg-config zlib1g-dev + packages=(build-essential pkg-config zlib1g-dev) + arch=$(dpkg --print-architecture) || arch= + for package in "${packages[@]}"; do + if [[ -n "$arch" ]] && + status=$(dpkg-query -W -f='${db:Status-Eflag} ${db:Status-Status}' "$package:$arch") && + [[ "$status" == "ok installed" ]]; then + continue + fi + sudo apt-get update + sudo apt-get install -y --no-install-recommends "${packages[@]}" + break + done - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 with: version: "0.12.1"