2025-12-19 18:30:40 +03:00

111 lines
2.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@v3
- 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@v3
- 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@v3
- 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@v3
- 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
test:
runs-on: ubuntu-latest
timeout-minutes: 120
name: test
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-system-deps
- uses: ./.github/actions/install-risc0
- name: Install active toolchain
run: rustup install
- name: Unit tests
env:
RISC0_DEV_MODE: "1"
run: cargo test --workspace --features no_docker
- name: Test valid proof
env:
NSSA_WALLET_HOME_DIR: ./integration-tests/configs/debug/wallet
RUST_LOG: "info"
run: cargo run --bin integration-tests -- ./integration-tests/configs/debug/ test_success_private_transfer_to_another_owned_account
- name: Integration tests
env:
NSSA_WALLET_HOME_DIR: ./integration-tests/configs/debug/wallet
RUST_LOG: "info"
RISC0_DEV_MODE: "1"
run: cargo run --bin integration-tests -- ./integration-tests/configs/debug/ all