mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
462 lines
18 KiB
YAML
462 lines
18 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push:
|
|
branches: ["*"]
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
concurrency:
|
|
group: lint-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
nomos_binaries:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NOMOS_CIRCUITS: ${{ github.workspace }}/.tmp/nomos-circuits
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
RUSTFLAGS: -C debuginfo=0
|
|
CARGO_TARGET_DIR: ${{ github.workspace }}/.tmp/nomos-target
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install system dependencies
|
|
run: |
|
|
set -euo pipefail
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$NOMOS_CIRCUITS"
|
|
echo "NOMOS_CIRCUITS=$NOMOS_CIRCUITS" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- name: Build nomos binaries
|
|
run: |
|
|
SRC_DIR="${GITHUB_WORKSPACE}/.tmp/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
|
|
- name: Package binaries
|
|
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 .
|
|
- uses: actions/upload-artifact@v4
|
|
if: env.ACT != 'true'
|
|
with:
|
|
name: nomos-binaries-linux-amd64
|
|
path: nomos-binaries.tar.gz
|
|
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
|
|
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
components: rustfmt
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-target-fmt-${{ hashFiles('**/Cargo.lock') }}-nightly-2025-09-14
|
|
restore-keys: ${{ runner.os }}-target-fmt-
|
|
- run: cargo +nightly-2025-09-14 fmt --all -- --check
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
|
|
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
components: clippy
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-target-clippy-${{ hashFiles('**/Cargo.lock') }}-nightly-2025-09-14
|
|
restore-keys: ${{ runner.os }}-target-clippy-
|
|
- run: cargo +nightly-2025-09-14 clippy --all --all-targets --all-features -- -D warnings
|
|
|
|
deny:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
|
|
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- name: Install cargo-deny
|
|
run: cargo install cargo-deny --locked --version 0.18.2
|
|
- run: cargo deny check --hide-inclusion-graph -c .cargo-deny.toml --show-stats -D warnings
|
|
|
|
taplo:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- name: Install taplo
|
|
run: |
|
|
TAPLO_VERSION=0.9.3
|
|
cargo install taplo-cli --locked --version ${TAPLO_VERSION}
|
|
- run: taplo fmt --check
|
|
- run: taplo lint
|
|
|
|
machete:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
|
|
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- name: Install cargo-machete
|
|
run: cargo +nightly-2025-09-14 install --git https://github.com/bnjbvr/cargo-machete --locked cargo-machete
|
|
- run: cargo machete
|
|
|
|
local_smoke:
|
|
needs: nomos_binaries
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
POL_PROOF_DEV_MODE: true
|
|
LOCAL_DEMO_RUN_SECS: 120
|
|
LOCAL_DEMO_VALIDATORS: 1
|
|
LOCAL_DEMO_EXECUTORS: 1
|
|
NOMOS_CIRCUITS: ${{ github.workspace }}/.tmp/nomos-circuits
|
|
NOMOS_KZGRS_PARAMS_PATH: ${{ github.workspace }}/.tmp/nomos-circuits
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
RUSTFLAGS: -C debuginfo=0
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set temp dir
|
|
run: |
|
|
echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
|
|
echo "CARGO_TARGET_DIR=${{ runner.temp }}/target-local" >> "$GITHUB_ENV"
|
|
- name: Install system dependencies
|
|
run: |
|
|
set -euo pipefail
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
else
|
|
apt-get update
|
|
apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
fi
|
|
- name: Install nomos circuits
|
|
run: |
|
|
./scripts/setup-nomos-circuits.sh v0.3.1 "$NOMOS_CIRCUITS"
|
|
echo "NOMOS_CIRCUITS=$NOMOS_CIRCUITS" >> "$GITHUB_ENV"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- name: Build nomos binaries (act fallback)
|
|
if: env.ACT == 'true'
|
|
run: |
|
|
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" .
|
|
- name: Download prebuilt nomos binaries
|
|
if: env.ACT != 'true'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: nomos-binaries-linux-amd64
|
|
path: ${{ runner.temp }}/nomos-binaries
|
|
- name: Use local nomos binaries (act)
|
|
if: env.ACT == 'true'
|
|
run: |
|
|
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
|
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
|
- name: Install nomos binaries
|
|
run: |
|
|
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
|
tar -xzf "${BIN_DIR}/nomos-binaries.tar.gz" -C "${BIN_DIR}"
|
|
sudo cp "${BIN_DIR}/nomos-node" /usr/local/bin/
|
|
sudo cp "${BIN_DIR}/nomos-executor" /usr/local/bin/
|
|
sudo cp "${BIN_DIR}/nomos-cli" /usr/local/bin/
|
|
sudo chmod +x /usr/local/bin/nomos-node /usr/local/bin/nomos-executor /usr/local/bin/nomos-cli
|
|
echo "NOMOS_NODE_BIN=/usr/local/bin/nomos-node" >> "$GITHUB_ENV"
|
|
echo "NOMOS_EXECUTOR_BIN=/usr/local/bin/nomos-executor" >> "$GITHUB_ENV"
|
|
- name: Stage KZG params for local run
|
|
run: |
|
|
rm -rf 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
|
|
- name: Run local runner smoke (ignored test)
|
|
run: |
|
|
cargo +nightly-2025-09-14 test -p runner-examples --test local_runner_bin_smoke -- --ignored --nocapture
|
|
|
|
compose_smoke:
|
|
needs: nomos_binaries
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TMPDIR: ${{ github.workspace }}/.tmp
|
|
NOMOS_CIRCUITS: ${{ github.workspace }}/.tmp/nomos-circuits
|
|
NOMOS_TESTNET_IMAGE: nomos-testnet:local
|
|
DOCKER_BUILDKIT: 1
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare workspace tmpdir
|
|
run: mkdir -p "$TMPDIR"
|
|
|
|
- name: Download prebuilt nomos binaries
|
|
if: env.ACT != 'true'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: nomos-binaries-linux-amd64
|
|
path: ${{ runner.temp }}/nomos-binaries
|
|
- name: Use local nomos binaries (act)
|
|
if: env.ACT == 'true'
|
|
run: |
|
|
mkdir -p "${RUNNER_TEMP}/nomos-binaries"
|
|
tar -xzf "${RUNNER_TEMP}/nomos-binaries.tar.gz" -C "${RUNNER_TEMP}/nomos-binaries"
|
|
- name: Stage nomos binaries into build context
|
|
run: |
|
|
BIN_DIR="${RUNNER_TEMP}/nomos-binaries"
|
|
tar -xzf "${BIN_DIR}/nomos-binaries.tar.gz" -C "${BIN_DIR}"
|
|
mkdir -p testing-framework/assets/stack/bin
|
|
cp "${BIN_DIR}/nomos-node" testing-framework/assets/stack/bin/
|
|
cp "${BIN_DIR}/nomos-executor" testing-framework/assets/stack/bin/
|
|
cp "${BIN_DIR}/nomos-cli" testing-framework/assets/stack/bin/
|
|
rm -rf 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
|
|
|
|
- name: Prune docker to free space
|
|
run: |
|
|
docker system prune -af --volumes || true
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- name: Install system dependencies
|
|
run: |
|
|
set -euo pipefail
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
else
|
|
apt-get update
|
|
apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
fi
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
set -euo pipefail
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
else
|
|
apt-get update
|
|
apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
|
|
fi
|
|
|
|
- name: Cache cargo registry
|
|
if: env.ACT != 'true'
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Install circuits for host build
|
|
env:
|
|
NOMOS_CIRCUITS_PLATFORM: linux-x86_64
|
|
NOMOS_CIRCUITS_REBUILD_RAPIDSNARK: "1"
|
|
RAPIDSNARK_FORCE_REBUILD: "1"
|
|
RAPIDSNARK_BUILD_GMP: "0"
|
|
RAPIDSNARK_USE_ASM: "OFF"
|
|
run: |
|
|
CIRCUITS_DIR="${NOMOS_CIRCUITS}"
|
|
chmod +x scripts/setup-nomos-circuits.sh
|
|
scripts/setup-nomos-circuits.sh v0.3.1 "$CIRCUITS_DIR"
|
|
# Copy into build context so Docker doesn't need network
|
|
rm -rf testing-framework/assets/stack/kzgrs_test_params
|
|
mkdir -p testing-framework/assets/stack/kzgrs_test_params
|
|
if command -v rsync >/dev/null 2>&1; then
|
|
rsync -a --delete "$CIRCUITS_DIR"/ testing-framework/assets/stack/kzgrs_test_params/
|
|
else
|
|
rm -rf testing-framework/assets/stack/kzgrs_test_params/*
|
|
cp -a "$CIRCUITS_DIR"/. testing-framework/assets/stack/kzgrs_test_params/
|
|
fi
|
|
echo "NOMOS_CIRCUITS=$CIRCUITS_DIR" >> "$GITHUB_ENV"
|
|
echo "CIRCUITS_OVERRIDE=testing-framework/assets/stack/kzgrs_test_params" >> "$GITHUB_ENV"
|
|
|
|
- name: Build compose test image
|
|
env:
|
|
DOCKER_CLI_HINTS: "false"
|
|
IMAGE_TAG: ${{ env.NOMOS_TESTNET_IMAGE }}
|
|
CIRCUITS_OVERRIDE: ${{ env.CIRCUITS_OVERRIDE }}
|
|
run: |
|
|
chmod +x testing-framework/assets/stack/scripts/build_test_image.sh
|
|
testing-framework/assets/stack/scripts/build_test_image.sh
|
|
|
|
- name: Run compose mixed workload binary
|
|
env:
|
|
POL_PROOF_DEV_MODE: "true"
|
|
COMPOSE_NODE_PAIRS: "1x1"
|
|
NOMOS_TESTNET_IMAGE: ${{ env.NOMOS_TESTNET_IMAGE }}
|
|
COMPOSE_RUNNER_HOST: ${{ env.ACT == 'true' && 'host.docker.internal' || '127.0.0.1' }}
|
|
RUST_BACKTRACE: "1"
|
|
NOMOS_TESTS_TRACING: "true"
|
|
NOMOS_LOG_DIR: "${{ github.workspace }}/.tmp/compose-logs"
|
|
NOMOS_LOG_LEVEL: "info"
|
|
run: |
|
|
mkdir -p "$TMPDIR"
|
|
if [ "${{ env.ACT }}" = "true" ]; then
|
|
export COMPOSE_RUNNER_PRESERVE=1
|
|
fi
|
|
cargo run -p runner-examples --bin compose_runner -- --nocapture
|
|
|
|
- name: Collect compose logs
|
|
if: failure()
|
|
run: |
|
|
mkdir -p ci-artifacts/compose
|
|
if [ -d "${TMPDIR}/compose-logs" ]; then
|
|
tar -czf ci-artifacts/compose/node-logs.tgz -C "${TMPDIR}/compose-logs" .
|
|
fi
|
|
mkdir -p ci-artifacts/compose
|
|
docker ps -a --filter "name=nomos-compose-" --format '{{.ID}} {{.Names}} {{.Status}}' > ci-artifacts/compose/containers.txt || true
|
|
for id in $(docker ps -a --filter "name=nomos-compose-" -q); do
|
|
docker logs "$id" > "ci-artifacts/compose/${id}.log" 2>&1 || true
|
|
done
|
|
|
|
- name: Upload compose artifacts
|
|
if: failure() && env.ACT != 'true'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: compose-mixed-workload-logs
|
|
path: ci-artifacts
|
|
|
|
- name: Cleanup compose containers
|
|
if: always() && env.ACT != 'true'
|
|
run: |
|
|
ids=$(docker ps -a --filter "name=nomos-compose-" -q)
|
|
if [ -n "$ids" ]; then
|
|
docker rm -f $ids
|
|
fi
|
|
|
|
book:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTUP_TOOLCHAIN: nightly-2025-09-14
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-09-14
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
- name: Install mdBook toolchain
|
|
run: |
|
|
MDBOOK_VERSION=0.4.40
|
|
LINKCHECK_VERSION=0.7.7
|
|
MERMAID_VERSION=0.12.6
|
|
cargo +nightly-2025-09-14 install --locked mdbook --version ${MDBOOK_VERSION}
|
|
cargo +nightly-2025-09-14 install mdbook-linkcheck --version ${LINKCHECK_VERSION}
|
|
cargo +nightly-2025-09-14 install --locked mdbook-mermaid --version ${MERMAID_VERSION}
|
|
cargo +nightly-2025-09-14 install --locked typos-cli --version 1.20.11
|
|
- name: Spell check (typos)
|
|
run: typos --format brief book/src
|
|
- name: Markdown lint
|
|
run: npx -y markdownlint-cli2 "book/src/**/*.md"
|
|
- name: Build book
|
|
run: mdbook build book
|
|
- name: Check links
|
|
run: mdbook-linkcheck book
|