fix(tests): create values of block_size #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust | |
| on: | |
| merge_group: | |
| pull_request: | |
| push: | |
| branches: main | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_TERM_COLOR: always | |
| CARGO_PROFILE_DEV_DEBUG: 1 | |
| CARGO_PROFILE_RELEASE_DEBUG: 1 | |
| RUST_BACKTRACE: short | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| jobs: | |
| changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - 'code/**' | |
| test: | |
| name: Unit Tests | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install Quint | |
| run: npm install -g @informalsystems/quint | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: "code" | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@cargo-nextest | |
| - name: Run tests | |
| run: | | |
| cargo nextest run \ | |
| --workspace \ | |
| --all-features \ | |
| --no-fail-fast \ | |
| --failure-output final \ | |
| --exclude informalsystems-malachitebft-test \ | |
| --exclude informalsystems-malachitebft-starknet-test \ | |
| --exclude informalsystems-malachitebft-starknet-test-mbt \ | |
| --exclude informalsystems-malachitebft-discovery-test | |
| integration: | |
| name: Integration Tests | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install Quint | |
| run: npm install -g @informalsystems/quint | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: "code" | |
| - name: Install cargo-maelstrom | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-maelstrom | |
| - name: Disable apparmor container restrictions | |
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Run integration tests (discovery) | |
| if: always() | |
| run: | | |
| cargo maelstrom --slots 8 \ | |
| --include 'package.equals(informalsystems-malachitebft-discovery-test)' | |
| - name: Run integration tests (Starknet app) | |
| if: always() | |
| run: | | |
| cargo maelstrom --slots 8 \ | |
| --include 'package.equals(informalsystems-malachitebft-starknet-test)' \ | |
| --exclude 'package.match(informalsystems-malachitebft-starknet-test-mbt)' | |
| - name: Run integration tests (Test app) | |
| if: always() | |
| run: | | |
| cargo maelstrom --slots 8 \ | |
| --include 'package.equals(informalsystems-malachitebft-test)' \ | |
| --exclude 'package.equals(informalsystems-malachitebft-test-mbt)' | |
| no_std: | |
| name: no_std compatibility | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: "code" | |
| target: thumbv7m-none-eabi | |
| - name: Check no_std compatibility | |
| run: cargo build --target thumbv7m-none-eabi -p informalsystems-malachitebft-peer | |
| clippy: | |
| name: Clippy | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: clippy | |
| cache-workspaces: "code" | |
| - name: Run clippy | |
| uses: actions-rs/clippy@master | |
| with: | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| args: --all-features --all-targets --manifest-path code/Cargo.toml | |
| fmt: | |
| name: Formatting | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt | |
| cache-workspaces: "code" | |
| - name: Check formatting | |
| uses: actions-rust-lang/rustfmt@v1 | |
| with: | |
| manifest-path: code/Cargo.toml | |
| msrv: | |
| name: MSRV | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache-workspaces: "code" | |
| - name: Install cargo-msrv | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-msrv | |
| - name: Check MSRV | |
| run: cargo msrv verify --manifest-path crates/engine/Cargo.toml --output-format minimal -- cargo check --all-features | |
| standalone: | |
| name: Standalone | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache-workspaces: "code" | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-hack | |
| - name: Check each crate with and without default features | |
| run: cargo hack check --workspace --each-feature --no-dev-deps |