mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-02-14 18:33:10 +00:00
183 lines
4.5 KiB
YAML
183 lines
4.5 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "!.github/workflows/*.yml"
|
|
|
|
pull_request:
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "!.github/workflows/*.yml"
|
|
|
|
name: General
|
|
|
|
jobs:
|
|
fmt-rs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Install nightly toolchain for rustfmt
|
|
run: rustup install nightly --profile minimal --component rustfmt
|
|
|
|
- name: Check Rust files are formatted
|
|
run: cargo +nightly fmt --check
|
|
|
|
fmt-toml:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Install taplo-cli
|
|
run: cargo install --locked taplo-cli
|
|
|
|
- name: Check TOML files are formatted
|
|
run: taplo fmt --check .
|
|
|
|
machete:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Install active toolchain
|
|
run: rustup install
|
|
|
|
- name: Install cargo-machete
|
|
run: cargo install cargo-machete
|
|
|
|
- name: Check for unused dependencies
|
|
run: cargo machete
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
|
|
name: lint
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: ./.github/actions/install-system-deps
|
|
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install active toolchain
|
|
run: rustup install
|
|
|
|
- name: Lint workspace
|
|
env:
|
|
RISC0_SKIP_BUILD: "1"
|
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
- name: Lint programs
|
|
env:
|
|
RISC0_SKIP_BUILD: "1"
|
|
run: cargo clippy -p "*programs" -- -D warnings
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: ./.github/actions/install-system-deps
|
|
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install active toolchain
|
|
run: rustup install
|
|
|
|
- name: Install nextest
|
|
run: cargo install cargo-nextest
|
|
|
|
- name: Run tests
|
|
env:
|
|
RISC0_DEV_MODE: "1"
|
|
RUST_LOG: "info"
|
|
run: cargo nextest run --no-fail-fast -- --skip tps_test --skip indexer_run_local_node
|
|
|
|
valid-proof-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: ./.github/actions/install-system-deps
|
|
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install active toolchain
|
|
run: rustup install
|
|
|
|
- name: Test valid proof
|
|
env:
|
|
RUST_LOG: "info"
|
|
run: cargo test -p integration_tests -- --exact private::private_transfer_to_owned_account
|
|
|
|
indexer-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: ./.github/actions/install-system-deps
|
|
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install active toolchain
|
|
run: rustup install
|
|
|
|
- name: Test indexer run
|
|
env:
|
|
RUST_LOG: "info"
|
|
run: |
|
|
git clone https://github.com/logos-blockchain/logos-blockchain.git
|
|
cd logos-blockchain
|
|
chmod 777 ./scripts/setup-nomos-circuits.sh && ./scripts/setup-nomos-circuits.sh
|
|
cargo build --all-features --all-targets
|
|
CONSENSUS_SLOT_TIME=5 POL_PROOF_DEV_MODE=true target/debug/nomos-node nodes/nomos-node/config-one-node.yaml --dev-mode-reset-chain-clock > /dev/null 2>&1
|
|
cd ..
|
|
cargo test -p integration_tests -- --exact indexer_run_local_node
|
|
|
|
artifacts:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
|
|
name: artifacts
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install just
|
|
run: cargo install just
|
|
|
|
- name: Build artifacts
|
|
run: just build-artifacts
|
|
|
|
- name: Check if artifacts match repository
|
|
run: |
|
|
if ! git diff --exit-code artifacts/; then
|
|
echo "❌ Artifacts in the repository are out of date!"
|
|
echo "Please run 'just build-artifacts' and commit the changes."
|
|
exit 1
|
|
fi
|
|
echo "✅ Artifacts are up to date"
|