ci: Refactor timelord action to use git-warp-time fallback

Updates the timelord action to fall back to git-warp-time when the cache
is completely empty, enabling timestamp restoration even on fresh builds.
Simplifies the interface by making inputs optional with sensible defaults
and adds Docker integration via buildkit-cache-dance.
This commit is contained in:
Tom Foster 2025-09-08 04:32:23 +01:00
commit 90baadd032
3 changed files with 62 additions and 34 deletions

View file

@ -150,10 +150,7 @@ jobs:
echo "Commit timestamp: $timestamp"
- uses: ./.forgejo/actions/timelord
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
with:
key: timelord-v0
path: .
id: timelord
- name: Cache Rust registry
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
@ -190,7 +187,6 @@ jobs:
var-lib-apt-${{ matrix.slug }}
key: var-lib-apt-${{ matrix.slug }}
- name: inject cache into docker
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: https://github.com/reproducible-containers/buildkit-cache-dance@v3.3.0
with:
cache-map: |
@ -202,7 +198,8 @@ jobs:
"id": "cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}"
},
"var-cache-apt-${{ matrix.slug }}": "/var/cache/apt",
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt"
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt",
"${{ steps.timelord.outputs.database-path }}": "/root/.cache/timelord"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}