ci : clear cache instead of "no timestamp" keys + fix macos (#23895)

* ci : ios use macos-15 again

* ci : add and test ccache-clear

* cont : fix

* cont : set permission

* cont : another permission

* cont : token

* cont : print key

* cont : bring back perms

* cont : test windows

* cont : add token

* cont : cleanup

* ci : make release jobs clean-up their ccache
This commit is contained in:
Georgi Gerganov
2026-05-30 08:52:30 +03:00
committed by GitHub
parent 1738129bee
commit d4204b03a5
3 changed files with 160 additions and 51 deletions
+22
View File
@@ -0,0 +1,22 @@
name: "ccache-clear"
description: "Delete all GitHub Actions caches matching a key prefix"
inputs:
key:
description: "Cache key prefix to match and delete"
required: true
runs:
using: "composite"
steps:
- name: Clear caches
shell: bash
run: |
CACHES=$(gh cache list --key "ccache-${{ inputs.key }}" --json id,key --jq '.[] | "\(.id) \(.key)"' 2>/dev/null)
if [ -z "$CACHES" ]; then
echo "No caches found with key prefix: ${{ inputs.key }}"
exit 0
fi
while read -r id key; do
echo "Deleting cache: $id ($key)"
gh cache delete "$id"
done <<< "$CACHES"
+18 -2
View File
@@ -13,6 +13,7 @@ concurrency:
queue: max queue: max
env: env:
GH_TOKEN: ${{ github.token }}
GGML_NLOOP: 3 GGML_NLOOP: 3
GGML_N_THREADS: 1 GGML_N_THREADS: 1
LLAMA_ARG_LOG_COLORS: 1 LLAMA_ARG_LOG_COLORS: 1
@@ -23,6 +24,9 @@ jobs:
cuda: cuda:
runs-on: windows-2022 runs-on: windows-2022
permissions:
actions: write
strategy: strategy:
matrix: matrix:
cuda: ['12.4', '13.3'] cuda: ['12.4', '13.3']
@@ -36,7 +40,6 @@ jobs:
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-windows-2022-x64-cuda-${{ matrix.cuda }} key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Install Cuda Toolkit - name: Install Cuda Toolkit
uses: ./.github/actions/windows-setup-cuda uses: ./.github/actions/windows-setup-cuda
@@ -67,9 +70,17 @@ jobs:
cmake --build build --config Release -j %NINJA_JOBS% -t ggml cmake --build build --config Release -j %NINJA_JOBS% -t ggml
cmake --build build --config Release cmake --build build --config Release
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
hip: hip:
runs-on: windows-2022 runs-on: windows-2022
permissions:
actions: write
env: env:
# Make sure this is in sync with build-cache.yml # Make sure this is in sync with build-cache.yml
HIPSDK_INSTALLER_VERSION: "26.Q1" HIPSDK_INSTALLER_VERSION: "26.Q1"
@@ -125,7 +136,6 @@ jobs:
# to populate the ccache for the release with manual runs of this workflow # to populate the ccache for the release with manual runs of this workflow
#key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }} #key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }} key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Build - name: Build
id: cmake_build id: cmake_build
@@ -144,3 +154,9 @@ jobs:
-DGPU_TARGETS="gfx1100" ` -DGPU_TARGETS="gfx1100" `
-DGGML_RPC=ON -DGGML_RPC=ON
cmake --build build -j ${env:NUMBER_OF_PROCESSORS} cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
#key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
+120 -49
View File
@@ -28,6 +28,7 @@ on:
] ]
env: env:
GH_TOKEN: ${{ github.token }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CMAKE_ARGS: "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON" CMAKE_ARGS: "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON"
@@ -83,6 +84,9 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions:
actions: write
steps: steps:
- name: Clone - name: Clone
id: checkout id: checkout
@@ -101,7 +105,6 @@ jobs:
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-${{ matrix.os }}-${{ matrix.arch }} key: release-${{ matrix.os }}-${{ matrix.arch }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Build - name: Build
id: cmake_build id: cmake_build
@@ -116,6 +119,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-${{ matrix.os }}-${{ matrix.arch }}
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -147,6 +155,9 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions:
actions: write
steps: steps:
- name: Clone - name: Clone
id: checkout id: checkout
@@ -161,13 +172,6 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
- name: ccache
if: ${{ matrix.build != 's390x' }}
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-${{ matrix.os }}-cpu
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Dependencies - name: Dependencies
id: depends id: depends
run: | run: |
@@ -181,6 +185,12 @@ jobs:
echo "CC=gcc-14" >> "$GITHUB_ENV" echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV" echo "CXX=g++-14" >> "$GITHUB_ENV"
- name: ccache
if: ${{ matrix.build != 's390x' }}
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-${{ matrix.os }}-cpu
- name: Build - name: Build
id: cmake_build id: cmake_build
run: | run: |
@@ -194,6 +204,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc) cmake --build build --config Release -j $(nproc)
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-${{ matrix.os }}-cpu
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -224,6 +239,9 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions:
actions: write
steps: steps:
- name: Clone - name: Clone
id: checkout id: checkout
@@ -238,12 +256,6 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-${{ matrix.os }}-vulkan
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Dependencies - name: Dependencies
id: depends id: depends
run: | run: |
@@ -259,6 +271,11 @@ jobs:
echo "CXX=g++-14" >> "$GITHUB_ENV" echo "CXX=g++-14" >> "$GITHUB_ENV"
fi fi
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-${{ matrix.os }}-vulkan
- name: Build - name: Build
id: cmake_build id: cmake_build
run: | run: |
@@ -272,6 +289,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc) cmake --build build --config Release -j $(nproc)
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-${{ matrix.os }}-vulkan
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -294,6 +316,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
#permissions:
# actions: write
env: env:
NDK_VERSION: "29.0.14206865" NDK_VERSION: "29.0.14206865"
@@ -311,18 +336,6 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
# note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789)
# for some reason, the ccache does not improve the build time in this case
# example:
# cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831
# cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394
#
#- name: ccache
# uses: ggml-org/ccache-action@v1.2.21
# with:
# key: release-android-arm64
# append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:
@@ -339,6 +352,17 @@ jobs:
sdkmanager "ndk;${{ env.NDK_VERSION }}" sdkmanager "ndk;${{ env.NDK_VERSION }}"
echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV
# note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789)
# for some reason, the ccache does not improve the build time in this case
# example:
# cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831
# cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394
#
#- name: ccache
# uses: ggml-org/ccache-action@v1.2.21
# with:
# key: release-android-arm64
- name: Build - name: Build
id: cmake_build id: cmake_build
run: | run: |
@@ -357,6 +381,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc) cmake --build build --config Release -j $(nproc)
#- name: ccache-clear
# uses: ./.github/actions/ccache-clear
# with:
# key: release-android-arm64
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -379,6 +408,9 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
permissions:
actions: write
outputs: outputs:
openvino_version: ${{ steps.openvino_version.outputs.value }} openvino_version: ${{ steps.openvino_version.outputs.value }}
@@ -409,7 +441,6 @@ jobs:
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-ubuntu-24.04-openvino-release-no-preset-v1 key: release-ubuntu-24.04-openvino-release-no-preset-v1
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Dependencies - name: Dependencies
run: | run: |
@@ -447,6 +478,11 @@ jobs:
-DGGML_OPENVINO=ON -DGGML_OPENVINO=ON
cmake --build build/ReleaseOV --config Release -j $(nproc) cmake --build build/ReleaseOV --config Release -j $(nproc)
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-ubuntu-24.04-openvino-release-no-preset-v1
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -469,6 +505,9 @@ jobs:
runs-on: windows-2025 runs-on: windows-2025
permissions:
actions: write
strategy: strategy:
matrix: matrix:
include: include:
@@ -488,15 +527,14 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
- name: Install Ninja
run: |
choco install ninja
- name: ccache - name: ccache
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-windows-2025-${{ matrix.arch }}-cpu key: release-windows-2025-${{ matrix.arch }}-cpu
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Install Ninja
run: |
choco install ninja
- name: Build - name: Build
shell: cmd shell: cmd
@@ -512,6 +550,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release cmake --build build --config Release
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-windows-2025-${{ matrix.arch }}-cpu
- name: Pack artifacts - name: Pack artifacts
id: pack_artifacts id: pack_artifacts
run: | run: |
@@ -530,6 +573,9 @@ jobs:
runs-on: windows-2025 runs-on: windows-2025
permissions:
actions: write
env: env:
OPENBLAS_VERSION: 0.3.23 OPENBLAS_VERSION: 0.3.23
VULKAN_VERSION: 1.4.313.2 VULKAN_VERSION: 1.4.313.2
@@ -558,12 +604,6 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Install Vulkan SDK - name: Install Vulkan SDK
id: get_vulkan id: get_vulkan
if: ${{ matrix.backend == 'vulkan' }} if: ${{ matrix.backend == 'vulkan' }}
@@ -578,6 +618,11 @@ jobs:
run: | run: |
choco install ninja choco install ninja
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }}
- name: Install OpenCL Headers and Libs - name: Install OpenCL Headers and Libs
id: install_opencl id: install_opencl
if: ${{ matrix.backend == 'opencl-adreno' && matrix.arch == 'arm64' }} if: ${{ matrix.backend == 'opencl-adreno' && matrix.arch == 'arm64' }}
@@ -604,6 +649,11 @@ jobs:
cmake -S . -B build ${{ matrix.defines }} -DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_BACKEND_DL=ON -DLLAMA_BUILD_BORINGSSL=ON cmake -S . -B build ${{ matrix.defines }} -DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_BACKEND_DL=ON -DLLAMA_BUILD_BORINGSSL=ON
cmake --build build --config Release --target ${{ matrix.target }} cmake --build build --config Release --target ${{ matrix.target }}
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }}
- name: Pack artifacts - name: Pack artifacts
id: pack_artifacts id: pack_artifacts
run: | run: |
@@ -621,6 +671,9 @@ jobs:
runs-on: windows-2022 runs-on: windows-2022
permissions:
actions: write
strategy: strategy:
matrix: matrix:
cuda: ['12.4', '13.3'] cuda: ['12.4', '13.3']
@@ -637,12 +690,6 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "tools/ui/package-lock.json" cache-dependency-path: "tools/ui/package-lock.json"
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Install Cuda Toolkit - name: Install Cuda Toolkit
uses: ./.github/actions/windows-setup-cuda uses: ./.github/actions/windows-setup-cuda
with: with:
@@ -653,6 +700,11 @@ jobs:
run: | run: |
choco install ninja choco install ninja
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
- name: Build - name: Build
id: cmake_build id: cmake_build
shell: cmd shell: cmd
@@ -669,6 +721,11 @@ jobs:
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1 set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
cmake --build build --config Release -j %NINJA_JOBS% --target ggml-cuda cmake --build build --config Release -j %NINJA_JOBS% --target ggml-cuda
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-windows-2022-x64-cuda-${{ matrix.cuda }}
- name: Pack artifacts - name: Pack artifacts
id: pack_artifacts id: pack_artifacts
run: | run: |
@@ -748,7 +805,6 @@ jobs:
# uses: ggml-org/ccache-action@v1.2.21 # uses: ggml-org/ccache-action@v1.2.21
# with: # with:
# key: release-windows-2022-x64-sycl # key: release-windows-2022-x64-sycl
# append-timestamp: false # note: use this only with non-concurrent jobs!
# #
# - name: Build # - name: Build
# id: cmake_build # id: cmake_build
@@ -869,7 +925,6 @@ jobs:
# uses: ggml-org/ccache-action@v1.2.21 # uses: ggml-org/ccache-action@v1.2.21
# with: # with:
# key: release-ubuntu-24.04-sycl # key: release-ubuntu-24.04-sycl
# append-timestamp: false # note: use this only with non-concurrent jobs!
# #
# - name: Build # - name: Build
# id: cmake_build # id: cmake_build
@@ -908,6 +963,9 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
permissions:
actions: write
strategy: strategy:
matrix: matrix:
include: include:
@@ -938,7 +996,6 @@ jobs:
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }} key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Dependencies - name: Dependencies
id: depends id: depends
@@ -996,6 +1053,11 @@ jobs:
${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j $(nproc) cmake --build build --config Release -j $(nproc)
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-ubuntu-22.04-rocm-${{ matrix.ROCM_VERSION }}
- name: Determine tag name - name: Determine tag name
id: tag id: tag
uses: ./.github/actions/get-tag-name uses: ./.github/actions/get-tag-name
@@ -1021,6 +1083,9 @@ jobs:
runs-on: windows-2022 runs-on: windows-2022
permissions:
actions: write
env: env:
HIPSDK_INSTALLER_VERSION: "26.Q1" HIPSDK_INSTALLER_VERSION: "26.Q1"
@@ -1060,7 +1125,6 @@ jobs:
uses: ggml-org/ccache-action@v1.2.21 uses: ggml-org/ccache-action@v1.2.21
with: with:
key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }} key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
append-timestamp: false # note: use this only with non-concurrent jobs!
- name: Install ROCm - name: Install ROCm
if: steps.cache-rocm.outputs.cache-hit != 'true' if: steps.cache-rocm.outputs.cache-hit != 'true'
@@ -1120,6 +1184,11 @@ jobs:
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\" cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\" cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
- name: ccache-clear
uses: ./.github/actions/ccache-clear
with:
key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
- name: Pack artifacts - name: Pack artifacts
id: pack_artifacts id: pack_artifacts
run: | run: |
@@ -1134,7 +1203,9 @@ jobs:
ios-xcode-build: ios-xcode-build:
needs: [check_release] needs: [check_release]
if: ${{ needs.check_release.outputs.should_release == 'true' }} if: ${{ needs.check_release.outputs.should_release == 'true' }}
runs-on: macos-26 # TODO: figure out how to make this work with macos-26
# https://github.com/ggml-org/llama.cpp/actions/runs/26652714555/job/78604869474
runs-on: macos-15
steps: steps:
- name: Checkout code - name: Checkout code