char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Georgi Gerganovci : apply ccache-clear with older/min/dry-run to all ccache jobs (#27602)985b14912

char/aliceai-t5-moe
2.2 KiB50 linesraw
1# note: place this as the last step of the job, so the new cache is saved by "Post ccache" right after the old one is cleared
2name: "ccache-clear"
3description: "Delete GitHub Actions caches matching a key prefix, oldest first"
4inputs:
5  key:
6    description: "Cache key prefix to match and delete"
7    required: true
8  older:
9    description: "Only delete caches created more than this long ago (e.g. 90m, 1h, 1d). By default all matching caches are deleted"
10    required: false
11    default: ""
12  min:
13    description: "Stop deleting if fewer than this many caches would remain (e.g. 1). By default there is no minimum"
14    required: false
15    default: "0"
16  dry-run:
17    description: "Only print the caches that would be deleted, without deleting them"
18    required: false
19    default: "false"
20
21runs:
22  using: "composite"
23  steps:
24    - name: Install GitHub CLI if missing
25      shell: bash
26      run: |
27        # e.g. in container jobs, where it is not preinstalled
28        if ! command -v gh >/dev/null 2>&1; then
29          echo "GitHub CLI not found, installing..."
30          if ! command -v curl >/dev/null 2>&1; then
31            apt-get update >/dev/null 2>&1 || true
32            apt-get install -y curl >/dev/null 2>&1 || true
33          fi
34          mkdir -p -m 755 /etc/apt/keyrings
35          curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null
36          chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
37          echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list
38          apt-get update >/dev/null 2>&1 || true
39          apt-get install -y gh || { echo "Failed to install GitHub CLI (gh)" >&2; exit 1; }
40        fi
41        command -v gh >/dev/null 2>&1 || { echo "GitHub CLI (gh) is required but could not be installed" >&2; exit 1; }
42
43    - name: Clear caches
44      shell: bash
45      run: |
46        bash scripts/ccache-clear.sh \
47          --key "${{ inputs.key }}" \
48          --older "${{ inputs.older }}" \
49          --min "${{ inputs.min }}" \
50          ${{ inputs.dry-run == 'true' && '--dry-run' || '' }}