ci: Make timelord docker work locally

This commit is contained in:
Jade Ellis 2025-09-10 16:40:55 +01:00
commit a81546374d
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
2 changed files with 8 additions and 19 deletions

View file

@ -152,17 +152,6 @@ jobs:
- uses: ./.forgejo/actions/timelord
id: timelord
- name: Copy timelord cache to workspace
shell: bash
run: |
mkdir -p ./timelord
if [ -d "${{ steps.timelord.outputs.database-path }}" ]; then
cp -r "${{ steps.timelord.outputs.database-path }}"/* ./timelord/
echo "Copied timelord cache to workspace"
else
echo "No timelord cache to copy"
fi
- name: Cache Rust registry
if: ${{ env.BUILDKIT_ENDPOINT == '' }}
uses: actions/cache@v3
@ -210,7 +199,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 }}":"/timelord"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

View file

@ -53,6 +53,8 @@ ENV BINSTALL_VERSION=1.13.0
ENV CARGO_SBOM_VERSION=0.9.1
# renovate: datasource=crate depName=lddtree
ENV LDDTREE_VERSION=0.3.7
# renovate: datasource=crate depName=timelord-cli
ENV TIMELORD_VERSION=3.0.1
# Install unpackaged tools
RUN <<EOF
@ -60,7 +62,7 @@ RUN <<EOF
curl --retry 5 -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-sbom --version $CARGO_SBOM_VERSION
cargo binstall --no-confirm lddtree --version $LDDTREE_VERSION
cargo binstall --no-confirm timelord-cli@3.0.1
cargo binstall --no-confirm timelord-cli --version $TIMELORD_VERSION
EOF
# Set up xx (cross-compilation scripts)
@ -136,12 +138,9 @@ FROM toolchain AS builder
COPY . .
# Restore timestamps from timelord cache if available
RUN if [ -f /app/timelord/timelord.db ]; then \
RUN --mount=type=cache,target=/timelord/ \
echo "Restoring timestamps from timelord cache"; \
timelord sync --source-dir /app --cache-dir /app/timelord; \
else \
echo "No timelord cache found, timestamps will be build time"; \
fi
timelord sync --source-dir /app --cache-dir /timelord;
ARG TARGETPLATFORM