Refactor xtask CLI to use clap derive macros #2292
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: CI | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| RUST_BACKTRACE: "full" | |
| jobs: | |
| lint-and-test: | |
| name: fmt + clippy + nextest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Format | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets --all-features --no-deps | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Nextest | |
| run: cargo nextest run --workspace --all-targets --all-features | |
| feature-flags: | |
| name: Feature flag combinations | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: no-default-features | |
| features: "" | |
| args: "--no-default-features" | |
| - name: parallel | |
| features: "parallel" | |
| args: "-p checksums -p flist --features parallel" | |
| - name: async | |
| features: "async" | |
| args: "-p daemon -p core -p protocol -p engine --features async" | |
| - name: concurrent-sessions | |
| features: "concurrent-sessions" | |
| args: "-p daemon --features concurrent-sessions" | |
| - name: tracing | |
| features: "tracing" | |
| args: "-p daemon -p core -p engine --features tracing" | |
| - name: serde | |
| features: "serde" | |
| args: "-p logging -p protocol -p flist --features serde" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: features-${{ matrix.name }} | |
| - name: Build (${{ matrix.name }}) | |
| run: cargo build --workspace ${{ matrix.args }} | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Test (${{ matrix.name }}) | |
| run: cargo nextest run --workspace ${{ matrix.args }} | |
| interop-upstream: | |
| name: interop with upstream rsync | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| # Remove continue-on-error once tests are stable | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: interop | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| pkg-config \ | |
| zlib1g-dev \ | |
| curl \ | |
| autoconf \ | |
| automake \ | |
| libtool \ | |
| libacl1-dev \ | |
| libattr1-dev | |
| - name: Run interop tests | |
| run: bash tools/ci/run_interop.sh | |