110 add config for default sizes of query directory and similar ops #314
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: ["main"] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| COMMON_FEATURES: "sign,encrypt,compress,kerberos" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rustlang/rust:nightly | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| compile_features: [async, multi_threaded, single_threaded] | |
| services: | |
| samba: | |
| image: ghcr.io/avivnaaman/smb-tests:latest | |
| env: | |
| ACCOUNT_LocalAdmin: 123456 | |
| SAMBA_CONF_LOG_LEVEL: 1 | |
| SAMBA_VOLUME_CONFIG_MyShare: "[MyShare]; path=/shares/MyShare; read only = no; browseable = yes; create mask = 0777; directory mask = 0777; smb encrypt = desired" | |
| SAMBA_VOLUME_CONFIG_PublicShare: "[PublicShare]; path=/shares/PublicShare; read only = no; browseable = yes; guest ok = yes; smb encrypt = disabled" | |
| SAMBA_GLOBAL_CONFIG_smb_SPACE_ports: "139 445" | |
| SAMBA_GLOBAL_CONFIG_smb_SPACE_encrypt: "auto" | |
| options: --name samba --privileged --cap-add NET_ADMIN | |
| env: | |
| SMB_RUST_TESTS_SERVER: samba | |
| RUST_LOG: debug | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Prepare async tests | |
| if: ${{ matrix.compile_features == 'async' }} | |
| run: | | |
| echo "COMMON_FEATURES=${COMMON_FEATURES},quic" >> "${GITHUB_ENV}" | |
| apt update | |
| apt install -y libibverbs1 ibverbs-utils librdmacm1 libibumad3 ibverbs-providers rdma-core libibverbs-dev iproute2 perftest librdmacm-dev rdmacm-utils libprotobuf-dev protobuf-compiler clang | |
| - name: Format/${{ matrix.compile_features }} | |
| run: | | |
| rustup component add rustfmt | |
| cargo fmt --verbose --check | |
| - name: Lint/${{ matrix.compile_features }} | |
| run: | | |
| rustup component add clippy | |
| cargo clippy --verbose --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}" -- -Dclippy::all | |
| - name: Tests/${{ matrix.compile_features }} | |
| run: | | |
| cargo test --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}" -- --nocapture | |
| # Test without encryption and compression | |
| cargo test --no-default-features --features "${{ matrix.compile_features }},sign" -- --nocapture | |
| # Test signing with specific algorithms | |
| cargo test --no-default-features --features "${{ matrix.compile_features }},sign_cmac" -- --nocapture | |
| cargo test --no-default-features --features "${{ matrix.compile_features }},sign_gmac" -- --nocapture | |
| cargo test --no-default-features --features "${{ matrix.compile_features }},sign_hmac" -- --nocapture | |
| - name: Build/${{ matrix.compile_features }} | |
| run: | | |
| cargo build --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}" | |
| cargo doc --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}" | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| rust: [1.85, stable] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setting up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| # Building ignores the lock file, to prevent crates usage broken. | |
| - name: Remove lock file | |
| run: rm Cargo.lock | |
| - name: Build and Doc (Async) | |
| run: | | |
| cargo build --no-default-features --features "async,${COMMON_FEATURES}" | |
| - name: Build and Doc (Multi-threaded) | |
| run: | | |
| cargo build --no-default-features --features "multi_threaded,${COMMON_FEATURES}" | |
| - name: Build and Doc (Single-threaded) | |
| run: | | |
| cargo build --no-default-features --features "single_threaded,${COMMON_FEATURES}" | |
| publish: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:1.85 | |
| needs: [test, build] | |
| environment: production | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setting up environment | |
| run: apt update && apt install -y jq | |
| - name: Verify tag matches Cargo.toml version | |
| run: | | |
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
| CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') | |
| if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then | |
| echo "Tag version ($TAG_VERSION) doesn't match Cargo.toml version ($CARGO_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Publish to crates.io | |
| # Currently, MSRV does not support the `cargo publish --workspace` command, so putting all packages explicitly is required. | |
| # Also, versions are always workspace-defined, so publishing all packages together is required. | |
| run: | | |
| for crate_name in smb-tests smb-dtyp smb-fscc smb-msg smb-transport smb-rpc smb; do | |
| echo "Publishing crate: $crate_name" | |
| cargo publish -p ${crate_name} --token ${{ secrets.CRATES_IO_TOKEN }} | |
| done |