Skip to content

Bump to v0.11.0

Bump to v0.11.0 #358

Workflow file for this run

name: Build
on:
push:
branches: ["main"]
tags: ["v*"]
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: smb-rs-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
COMMON_FEATURES: "sign,encrypt,compress,kerberos"
jobs:
test:
runs-on: ubuntu-latest
container:
image: rustlang/rust:nightly
timeout-minutes: 15
strategy:
matrix:
compile_features: [async, multi_threaded, single_threaded]
services:
samba:
image: ghcr.io/afiffon/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
RUSTFLAGS: "-D warnings"
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: Build/${{ matrix.compile_features }}
run: |
cargo build --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}"
- name: Tests/${{ matrix.compile_features }}
run: |
cargo test -p smb-msg --features server --no-default-features -- --nocapture
cargo test -p smb-msg --features both --no-default-features -- --nocapture
# Full client tests with all features
cargo test --no-default-features --features "${{ matrix.compile_features }},${COMMON_FEATURES}" -- --nocapture
- name: Doc/${{ matrix.compile_features }}
run: |
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:stable
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
run: |
cargo publish --workspace --token ${{ secrets.CRATES_IO_TOKEN }}