From 6613f626a1bcf3a0bf6a56eed8201060a5848de3 Mon Sep 17 00:00:00 2001 From: Yingfan Guo <115908952+sentomk@users.noreply.github.com> Date: Mon, 26 Oct 2026 23:23:58 +0800 Subject: [PATCH] ci: pin full-matrix linux runners to ubuntu-24.04 Problem - ubuntu-latest now resolves to Ubuntu 26.04 (resolute), which no longer ships clang-14 or clang-16. The required clang-14 C++17 and clang-16 C++20 jobs fail at apt-get install, blocking every PR. Implementation - Pin all Linux entries of the ci-full matrix to ubuntu-24.04, which carries gcc-11, gcc-13, clang-14, clang-16 and clang-18. - Leave a comment next to the matrix, matching the existing windows-2022 pin. Tests - Verified by this PR's own CI run. --- .github/workflows/ci-full.yml | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-full.yml b/.github/workflows/ci-full.yml index c98c9a3..1bbc545 100644 --- a/.github/workflows/ci-full.yml +++ b/.github/workflows/ci-full.yml @@ -21,37 +21,42 @@ jobs: matrix: include: # ===== GCC ===== - - os: ubuntu-latest + # Linux jobs are pinned to images that preinstall their compiler: + # ubuntu-latest moved to 26.04 (resolute), which no longer ships + # clang-14 or clang-16, and downloading compilers from the runner + # apt mirror can take tens of minutes. ubuntu-22.04 provides + # gcc-11 and clang-14; ubuntu-24.04 provides the rest. + - os: ubuntu-22.04 compiler: gcc-11 cxx: g++-11 std: 17 - - os: ubuntu-latest + - os: ubuntu-22.04 compiler: gcc-11 cxx: g++-11 std: 20 - - os: ubuntu-latest + - os: ubuntu-24.04 compiler: gcc-13 cxx: g++-13 std: 23 - - os: ubuntu-latest + - os: ubuntu-24.04 compiler: gcc-13 cxx: g++-13 std: 26 # ===== Clang ===== - - os: ubuntu-latest + - os: ubuntu-22.04 compiler: clang-14 cxx: clang++-14 std: 17 - - os: ubuntu-latest + - os: ubuntu-24.04 compiler: clang-16 cxx: clang++-16 std: 20 - - os: ubuntu-latest + - os: ubuntu-24.04 compiler: clang-18 cxx: clang++-18 std: 23 - - os: ubuntu-latest + - os: ubuntu-24.04 compiler: clang-18 cxx: clang++-18 std: 26 @@ -91,16 +96,23 @@ jobs: if: runner.os == 'Linux' shell: bash run: | - sudo apt-get update + ver=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) + # Use the image's preinstalled compiler; fall back to apt only + # when it is missing. + if ! command -v "${{ matrix.cxx }}" >/dev/null; then + sudo apt-get update + if [[ "${{ matrix.compiler }}" == gcc* ]]; then + sudo apt-get install -y gcc-${ver} g++-${ver} + else + sudo apt-get install -y clang-${ver} + fi + fi if [[ "${{ matrix.compiler }}" == gcc* ]]; then - ver=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) - sudo apt-get install -y gcc-${ver} g++-${ver} sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${ver} 100 - elif [[ "${{ matrix.compiler }}" == clang* ]]; then - ver=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) - sudo apt-get install -y clang-${ver} + else sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${ver} 100 fi + "${{ matrix.cxx }}" --version # Windows: detect MSVC vs clang-cl - name: Configure CMake (Windows)