Skip redundant Toolkit package setup on prepared runners

This commit is contained in:
2026-10-18 21:04:32 -06:00
parent f86f34bd90
commit 1edc446940
5 changed files with 34 additions and 17 deletions
+1 -3
View File
@@ -15,9 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install SSH client
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends openssh-client
run: bash ci/ensure-build-deps.sh ssh
- name: Render measured benchmark history
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
+1 -3
View File
@@ -23,9 +23,7 @@ jobs:
with:
fetch-depth: 0
- name: Install build dependencies
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends libssl-dev pkg-config ca-certificates
run: bash ci/ensure-build-deps.sh base
- name: Compute wxWidgets cache key
id: wx-key
run: bash ci/wx-cache-key.sh
+1 -5
View File
@@ -46,11 +46,7 @@ jobs:
run: python3 ci/test-bench-badge.py
- name: Install build dependencies
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
libssl-dev pkg-config ca-certificates openssh-client \
xvfb xauth dbus-x11 fonts-dejavu-core >/dev/null
run: bash ci/ensure-build-deps.sh all
- name: Compute wxWidgets cache key
id: wx-key
+2 -6
View File
@@ -41,10 +41,7 @@ jobs:
- name: Install build dependencies
if: steps.surface.outputs.surface != 'documentation'
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
libssl-dev pkg-config ca-certificates >/dev/null
run: bash ci/ensure-build-deps.sh base
- name: Compute wxWidgets cache key
id: wx-key
@@ -91,8 +88,7 @@ jobs:
- name: Headless UI self-test
if: steps.surface.outputs.surface != 'documentation'
run: |
apt-get update -qq && apt-get install -y -qq --no-install-recommends \
xvfb xauth dbus-x11 fonts-dejavu-core >/dev/null
bash ci/ensure-build-deps.sh ui
BIN=target/release/alkane-toolkit
xvfb-run -a env GDK_BACKEND=x11 ALKANE_SELFTEST=1 "$BIN"
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Use the preinstalled CI image or install missing packages on older runners.
set -euo pipefail
mode="${1:?usage: ensure-build-deps.sh base|ui|all|ssh}"
case "$mode" in
base) packages=(libssl-dev pkg-config ca-certificates) ;;
ui) packages=(xvfb xauth dbus-x11 fonts-dejavu-core) ;;
ssh) packages=(openssh-client) ;;
all) packages=(libssl-dev pkg-config ca-certificates openssh-client
xvfb xauth dbus-x11 fonts-dejavu-core) ;;
*) echo "unknown dependency set: $mode" >&2; exit 2 ;;
esac
installed="$(dpkg-query -W -f='${Package} ${Status}\n' "${packages[@]}" 2>/dev/null || true)"
missing=()
for package in "${packages[@]}"; do
if ! grep -Fxq "$package install ok installed" <<< "$installed"; then
missing+=("$package")
fi
done
if [ "${#missing[@]}" -eq 0 ]; then
printf 'Build packages already installed: %s\n' "$mode"
exit 0
fi
printf 'Installing %s missing build packages\n' "${#missing[@]}"
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends "${packages[@]}"