|
| 1 | +# Dakota BuildStream Cache Warm — scheduled workflow |
| 2 | +# |
| 3 | +# Prevents cold-start timeouts by keeping the BST remote cache hot. |
| 4 | +# Runs Monday and Thursday mornings, well before typical PR merge windows. |
| 5 | +# |
| 6 | +# Context: Dakota BST builds have a 360-min timeout. When cache misses |
| 7 | +# (after junction ref bumps or gbm upstream rebuilds), the full GNOME |
| 8 | +# stack must rebuild from scratch, which can exceed 6h. This workflow |
| 9 | +# runs the build on schedule to ensure cache artifacts stay fresh. |
| 10 | + |
| 11 | +name: Warm BuildStream Cache |
| 12 | + |
| 13 | +on: |
| 14 | + schedule: |
| 15 | + # Monday and Thursday at 06:00 UTC — before European/US work hours |
| 16 | + - cron: '0 6 * * 1,4' |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +permissions: |
| 20 | + contents: read |
| 21 | + |
| 22 | +concurrency: |
| 23 | + group: dakota-cache-warm |
| 24 | + cancel-in-progress: false |
| 25 | + |
| 26 | +jobs: |
| 27 | + warm-cache: |
| 28 | + name: Build to warm cache |
| 29 | + runs-on: ubuntu-24.04 |
| 30 | + timeout-minutes: 420 |
| 31 | + steps: |
| 32 | + - name: Checkout repository |
| 33 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 34 | + with: |
| 35 | + ref: testing |
| 36 | + |
| 37 | + - name: Check bst2 image pin consistency |
| 38 | + uses: ./.github/actions/check-bst2-pin |
| 39 | + |
| 40 | + - name: Setup runner |
| 41 | + uses: projectbluefin/actions/bootc-build/setup-runner@7f79969c2ff74c51ac7f385cb0a86414975308d7 # v1 |
| 42 | + with: |
| 43 | + storage-backend: btrfs |
| 44 | + update-podman: true |
| 45 | + install-tools: '["just"]' |
| 46 | + |
| 47 | + - name: Restore BST cache |
| 48 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 |
| 49 | + with: |
| 50 | + path: ~/.cache/buildstream |
| 51 | + key: bst-warm-${{ hashFiles('elements/gnome-build-meta.bst', 'elements/freedesktop-sdk.bst') }} |
| 52 | + restore-keys: | |
| 53 | + bst-warm- |
| 54 | +
|
| 55 | + - name: Build default variant (cache mode) |
| 56 | + run: | |
| 57 | + set -euo pipefail |
| 58 | + # Build the default (non-nvidia) variant to warm the shared layer cache. |
| 59 | + # || true makes the step non-fatal — warming is best-effort. |
| 60 | + just bst build oci/bluefin.bst || true |
| 61 | + echo "Cache warm complete — artifacts pushed to remote CAS" |
| 62 | +
|
| 63 | + - name: Save BST cache |
| 64 | + if: always() |
| 65 | + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 |
| 66 | + with: |
| 67 | + path: ~/.cache/buildstream |
| 68 | + key: bst-warm-${{ hashFiles('elements/gnome-build-meta.bst', 'elements/freedesktop-sdk.bst') }} |
0 commit comments