Speed up act by reusing built binaries when present

This commit is contained in:
andrussal 2025-12-02 12:02:04 +01:00
parent 0b4d538dfd
commit 2f321e67e0

View File

@ -222,8 +222,13 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build nomos binaries (act fallback)
if: env.ACT == 'true'
if: env.ACT == 'true' && ! (startsWith(github.event_name, 'workflow_dispatch') && hashFiles('nomos-binaries.tar.gz') != '')
run: |
if [ -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
cp "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" "${RUNNER_TEMP}/"
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
else
SRC_DIR="${RUNNER_TEMP}/nomos-node-src"
mkdir -p "$SRC_DIR"
if [ ! -d "$SRC_DIR/.git" ]; then
@ -240,6 +245,7 @@ jobs:
cp "${CARGO_TARGET_DIR:-${RUNNER_TEMP}/target-local}/debug/nomos-executor" "${RUNNER_TEMP}/nomos-binaries/"
cp "${CARGO_TARGET_DIR:-${RUNNER_TEMP}/target-local}/debug/nomos-cli" "${RUNNER_TEMP}/nomos-binaries/"
tar -czf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries" .
fi
- name: Download prebuilt nomos binaries
if: env.ACT != 'true'
uses: actions/download-artifact@v4