- Add VfsFile: Send supertrait for Mutex compatibility - Fix SmbServerCommand: struct → Subcommand enum with Start variant - Fix tracing_subscriber::init() → try_init() to avoid panic when logger already initialized - Fix CLI subcommand name: smb-server → smb-start (flatten naming) - Add #[command(name = "smb-start")] for CLI disambiguation - Fix unused variable warnings (smb_fs.rs, smb_server_backend.rs) - Remove unused VfsFile imports (webdav.rs, scp_handler.rs) - Integration test: Docker smbclient verified (list, upload, read)
137 lines
3.4 KiB
YAML
137 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
check:
|
|
name: Check (${{ matrix.os }}, rust ${{ matrix.rust }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2025]
|
|
rust: ["1.85", stable]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt --check
|
|
|
|
- name: Run clippy lints
|
|
run: cargo clippy --all-targets -- -D warnings
|
|
|
|
- name: Run tests
|
|
run: cargo test
|
|
|
|
- name: Build documentation
|
|
run: cargo doc --no-deps
|
|
|
|
docker-tests:
|
|
name: Docker integration tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Start SMB containers
|
|
run: ./tests/docker/start.sh internal
|
|
|
|
- name: Run Docker integration tests
|
|
run: cargo test --test docker_integration -- --ignored
|
|
env:
|
|
RUST_LOG: smb2=info
|
|
|
|
- name: Stop containers
|
|
if: always()
|
|
run: ./tests/docker/stop.sh
|
|
|
|
consumer-tests:
|
|
name: Consumer integration tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Start consumer containers
|
|
run: ./tests/docker/start.sh consumer
|
|
|
|
- name: Run consumer integration tests
|
|
run: cargo test --features testing --test consumer_integration -- --ignored
|
|
env:
|
|
RUST_LOG: smb2=info
|
|
|
|
- name: Stop containers
|
|
if: always()
|
|
run: ./tests/docker/stop.sh
|
|
|
|
msrv:
|
|
name: Verify MSRV (1.85)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Install Rust toolchain (MSRV)
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.85"
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Check compilation on MSRV
|
|
run: cargo check
|
|
env:
|
|
RUSTFLAGS: "-D warnings"
|
|
|
|
ci-ok:
|
|
name: CI OK
|
|
runs-on: ubuntu-latest
|
|
needs: [check, docker-tests, consumer-tests, msrv]
|
|
if: always()
|
|
steps:
|
|
- name: Check all jobs passed
|
|
run: |
|
|
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
|
|
echo "Some jobs failed"
|
|
exit 1
|
|
fi
|
|
if [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
|
|
echo "Some jobs were cancelled"
|
|
exit 1
|
|
fi
|
|
echo "All jobs passed"
|