Cache nomos binary tarball per node rev

This commit is contained in:
andrussal 2025-12-03 04:23:56 +01:00
parent 0173a351c2
commit 8ca28898d6

View File

@ -7,6 +7,7 @@ on:
env:
CARGO_TERM_COLOR: always
NOMOS_NODE_REV: 2f60a0372c228968c3526c341ebc7e58bbd178dd
concurrency:
group: lint-${{ github.ref }}
@ -26,6 +27,12 @@ jobs:
CARGO_TARGET_DIR: ${{ github.workspace }}/.tmp/nomos-target
steps:
- uses: actions/checkout@v4
- name: Restore cached nomos binaries
id: restore-nomos-bins
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/nomos-binaries.tar.gz
key: ${{ runner.os }}-nomos-binaries-${{ env.NOMOS_NODE_REV }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
@ -47,6 +54,7 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build nomos binaries
if: steps.restore-nomos-bins.outputs.cache-hit != 'true'
run: |
SRC_DIR="${GITHUB_WORKSPACE}/.tmp/nomos-node-src"
mkdir -p "$SRC_DIR"
@ -54,18 +62,25 @@ jobs:
git clone https://github.com/logos-co/nomos-node.git "$SRC_DIR"
fi
cd "$SRC_DIR"
git fetch --depth 1 origin 2f60a0372c228968c3526c341ebc7e58bbd178dd
git checkout 2f60a0372c228968c3526c341ebc7e58bbd178dd
git fetch --depth 1 origin "${NOMOS_NODE_REV}"
git checkout "${NOMOS_NODE_REV}"
git reset --hard
git clean -fdx
cargo +nightly-2025-09-14 build --all-features -p nomos-node -p nomos-executor -p nomos-cli
- name: Package binaries
if: steps.restore-nomos-bins.outputs.cache-hit != 'true'
run: |
mkdir -p artifacts
cp "${CARGO_TARGET_DIR}/debug/nomos-node" artifacts/
cp "${CARGO_TARGET_DIR}/debug/nomos-executor" artifacts/
cp "${CARGO_TARGET_DIR}/debug/nomos-cli" artifacts/
tar -czf nomos-binaries.tar.gz -C artifacts .
- name: Save nomos binaries cache
if: steps.restore-nomos-bins.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/nomos-binaries.tar.gz
key: ${{ runner.os }}-nomos-binaries-${{ env.NOMOS_NODE_REV }}
- uses: actions/upload-artifact@v4
with:
name: nomos-binaries-linux-amd64