mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-05 23:03:07 +00:00
Adjust CI lint workflow caching and binaries reuse
This commit is contained in:
parent
2f321e67e0
commit
c4c033d912
77
.github/workflows/lint.yml
vendored
77
.github/workflows/lint.yml
vendored
@ -44,6 +44,10 @@ jobs:
|
|||||||
restore-keys: ${{ runner.os }}-cargo-
|
restore-keys: ${{ runner.os }}-cargo-
|
||||||
- name: Build nomos binaries
|
- name: Build nomos binaries
|
||||||
run: |
|
run: |
|
||||||
|
if [ "${ACT:-}" = "true" ] && [ -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
|
||||||
|
# Reuse previously built tar without rebuilding.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
SRC_DIR="${GITHUB_WORKSPACE}/.tmp/nomos-node-src"
|
SRC_DIR="${GITHUB_WORKSPACE}/.tmp/nomos-node-src"
|
||||||
mkdir -p "$SRC_DIR"
|
mkdir -p "$SRC_DIR"
|
||||||
if [ ! -d "$SRC_DIR/.git" ]; then
|
if [ ! -d "$SRC_DIR/.git" ]; then
|
||||||
@ -63,10 +67,16 @@ jobs:
|
|||||||
cp "${CARGO_TARGET_DIR}/debug/nomos-cli" artifacts/
|
cp "${CARGO_TARGET_DIR}/debug/nomos-cli" artifacts/
|
||||||
tar -czf nomos-binaries.tar.gz -C artifacts .
|
tar -czf nomos-binaries.tar.gz -C artifacts .
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: env.ACT != 'true'
|
|
||||||
with:
|
with:
|
||||||
name: nomos-binaries-linux-amd64
|
name: nomos-binaries-linux-amd64
|
||||||
path: nomos-binaries.tar.gz
|
path: nomos-binaries.tar.gz
|
||||||
|
continue-on-error: ${{ env.ACT == 'true' }}
|
||||||
|
- name: Persist binaries for act
|
||||||
|
if: env.ACT == 'true'
|
||||||
|
run: |
|
||||||
|
if [ ! -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
|
||||||
|
cp nomos-binaries.tar.gz "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz"
|
||||||
|
fi
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -222,30 +232,24 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-cargo-
|
restore-keys: ${{ runner.os }}-cargo-
|
||||||
- name: Build nomos binaries (act fallback)
|
- name: Build nomos binaries (act fallback)
|
||||||
if: env.ACT == 'true' && ! (startsWith(github.event_name, 'workflow_dispatch') && hashFiles('nomos-binaries.tar.gz') != '')
|
if: env.ACT == 'true' && hashFiles(format('{0}/nomos-binaries/nomos-binaries.tar.gz', runner.temp)) == ''
|
||||||
run: |
|
run: |
|
||||||
if [ -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
|
SRC_DIR="${RUNNER_TEMP}/nomos-node-src"
|
||||||
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
mkdir -p "$SRC_DIR"
|
||||||
cp "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" "${RUNNER_TEMP}/"
|
if [ ! -d "$SRC_DIR/.git" ]; then
|
||||||
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
git clone https://github.com/logos-co/nomos-node.git "$SRC_DIR"
|
||||||
else
|
|
||||||
SRC_DIR="${RUNNER_TEMP}/nomos-node-src"
|
|
||||||
mkdir -p "$SRC_DIR"
|
|
||||||
if [ ! -d "$SRC_DIR/.git" ]; then
|
|
||||||
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 reset --hard
|
|
||||||
git clean -fdx
|
|
||||||
cargo +nightly-2025-09-14 build --all-features -p nomos-node -p nomos-executor -p nomos-cli
|
|
||||||
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
|
||||||
cp "${CARGO_TARGET_DIR:-${RUNNER_TEMP}/target-local}/debug/nomos-node" "${RUNNER_TEMP}/nomos-binaries/"
|
|
||||||
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
|
fi
|
||||||
|
cd "$SRC_DIR"
|
||||||
|
git fetch --depth 1 origin 2f60a0372c228968c3526c341ebc7e58bbd178dd
|
||||||
|
git checkout 2f60a0372c228968c3526c341ebc7e58bbd178dd
|
||||||
|
git reset --hard
|
||||||
|
git clean -fdx
|
||||||
|
cargo +nightly-2025-09-14 build --all-features -p nomos-node -p nomos-executor -p nomos-cli
|
||||||
|
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
cp "${CARGO_TARGET_DIR:-${RUNNER_TEMP}/target-local}/debug/nomos-node" "${RUNNER_TEMP}/nomos-binaries/"
|
||||||
|
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" .
|
||||||
- name: Download prebuilt nomos binaries
|
- name: Download prebuilt nomos binaries
|
||||||
if: env.ACT != 'true'
|
if: env.ACT != 'true'
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -256,11 +260,22 @@ jobs:
|
|||||||
if: env.ACT == 'true'
|
if: env.ACT == 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
||||||
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
if [ -f "${RUNNER_TEMP}/nomos-binaries.tar.gz" ]; then
|
||||||
|
cp "${RUNNER_TEMP}/nomos-binaries.tar.gz" "${RUNNER_TEMP}/nomos-binaries/nomos-binaries.tar.gz"
|
||||||
|
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
elif [ -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
|
||||||
|
cp "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" "${RUNNER_TEMP}/nomos-binaries/"
|
||||||
|
tar -xzf "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
else
|
||||||
|
echo "nomos-binaries.tar.gz not found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Install nomos binaries
|
- name: Install nomos binaries
|
||||||
run: |
|
run: |
|
||||||
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
||||||
tar -xzf "${BIN_DIR}/nomos-binaries.tar.gz" -C "${BIN_DIR}"
|
if [ -f "${BIN_DIR}/nomos-binaries.tar.gz" ]; then
|
||||||
|
tar -xzf "${BIN_DIR}/nomos-binaries.tar.gz" -C "${BIN_DIR}"
|
||||||
|
fi
|
||||||
sudo cp "${BIN_DIR}/nomos-node" /usr/local/bin/
|
sudo cp "${BIN_DIR}/nomos-node" /usr/local/bin/
|
||||||
sudo cp "${BIN_DIR}/nomos-executor" /usr/local/bin/
|
sudo cp "${BIN_DIR}/nomos-executor" /usr/local/bin/
|
||||||
sudo cp "${BIN_DIR}/nomos-cli" /usr/local/bin/
|
sudo cp "${BIN_DIR}/nomos-cli" /usr/local/bin/
|
||||||
@ -273,6 +288,8 @@ jobs:
|
|||||||
mkdir -p testing-framework/assets/stack/kzgrs_test_params
|
mkdir -p testing-framework/assets/stack/kzgrs_test_params
|
||||||
rsync -a --delete "$NOMOS_CIRCUITS"/ testing-framework/assets/stack/kzgrs_test_params/ || true
|
rsync -a --delete "$NOMOS_CIRCUITS"/ testing-framework/assets/stack/kzgrs_test_params/ || true
|
||||||
- name: Run local runner smoke (ignored test)
|
- name: Run local runner smoke (ignored test)
|
||||||
|
env:
|
||||||
|
LOCAL_DEMO_RUN_SECS: ${{ env.ACT == 'true' && '20' || env.LOCAL_DEMO_RUN_SECS }}
|
||||||
run: |
|
run: |
|
||||||
cargo +nightly-2025-09-14 test -p runner-examples --test local_runner_bin_smoke -- --ignored --nocapture
|
cargo +nightly-2025-09-14 test -p runner-examples --test local_runner_bin_smoke -- --ignored --nocapture
|
||||||
|
|
||||||
@ -301,7 +318,15 @@ jobs:
|
|||||||
if: env.ACT == 'true'
|
if: env.ACT == 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
||||||
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
if [ -f "${RUNNER_TEMP}/nomos-binaries.tar.gz" ]; then
|
||||||
|
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
elif [ -f "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" ]; then
|
||||||
|
cp "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" "${RUNNER_TEMP}/nomos-binaries/"
|
||||||
|
tar -xzf "${GITHUB_WORKSPACE}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
else
|
||||||
|
echo "nomos-binaries.tar.gz not found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Stage nomos binaries into build context
|
- name: Stage nomos binaries into build context
|
||||||
run: |
|
run: |
|
||||||
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user