✨ zb: Add helper for IBus connection creation #3317
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: Lint, Build and Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| MSRV: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: -D warnings | |
| MSRV: 1.85.0 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.MSRV }} | |
| targets: x86_64-pc-windows-gnu, x86_64-apple-darwin, x86_64-unknown-freebsd, x86_64-unknown-netbsd, aarch64-linux-android | |
| components: rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check build with MSRV | |
| run: | | |
| cargo --locked check | |
| cargo --locked check --target x86_64-pc-windows-gnu | |
| cargo --locked check --target x86_64-apple-darwin | |
| cargo --locked check --target x86_64-unknown-freebsd | |
| cargo --locked check --target x86_64-unknown-netbsd | |
| cargo --locked check --target aarch64-linux-android | |
| # This would be nice but some optional deps (e.g `time`) move very fast wrt to MSRV. | |
| # cargo --locked check --all-features | |
| fmt: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: -D warnings | |
| RUST_BACKTRACE: full | |
| RUST_LOG: trace | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| # We use some nightly fmt options. | |
| toolchain: nightly | |
| components: rustfmt | |
| targets: x86_64-apple-darwin, x86_64-unknown-freebsd, x86_64-unknown-netbsd, x86_64-pc-windows-gnu, aarch64-linux-android | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: | | |
| cargo --locked fmt -- --check | |
| cargo --locked check --target x86_64-apple-darwin | |
| cargo --locked check --target x86_64-unknown-freebsd | |
| cargo --locked check --target x86_64-unknown-netbsd | |
| cargo --locked check --target x86_64-pc-windows-gnu | |
| cargo --locked check --target aarch64-linux-android | |
| clippy: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: -D warnings | |
| RUST_BACKTRACE: full | |
| RUST_LOG: trace | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| targets: x86_64-apple-darwin, x86_64-unknown-freebsd, x86_64-unknown-netbsd, x86_64-pc-windows-gnu, aarch64-linux-android | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Catch common mistakes and unwrap calls | |
| run: | | |
| cargo --locked clippy | |
| cargo --locked clippy --target x86_64-apple-darwin | |
| cargo --locked clippy --target x86_64-unknown-freebsd | |
| cargo --locked clippy --target x86_64-unknown-netbsd | |
| cargo --locked clippy --target x86_64-pc-windows-gnu | |
| cargo --locked clippy --target aarch64-linux-android | |
| linux_test: | |
| runs-on: ubuntu-latest | |
| needs: [fmt, clippy] | |
| env: | |
| RUSTFLAGS: -D warnings | |
| RUST_BACKTRACE: full | |
| RUST_LOG: trace | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup | |
| run: | | |
| sudo mkdir -p /run/user/$UID | | |
| sed -e s/UID/$UID/ -e s/PATH/path/ CI/dbus-session.conf > /tmp/dbus-session.conf | |
| sed -e s/UID/$UID/ -e s/PATH/abstract/ CI/dbus-session.conf > /tmp/dbus-session-abstract.conf | |
| sudo apt-get update | |
| sudo apt-get install -y dbus ibus | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build and Test | |
| run: | | |
| dbus-run-session --config-file /tmp/dbus-session-abstract.conf -- cargo --locked test --release --verbose -- basic_connection | |
| # Start IBus daemon for IBus test. | |
| ibus-daemon -d --xim | |
| sleep 2 | |
| # All features except tokio. | |
| dbus-run-session --config-file /tmp/dbus-session.conf -- \ | |
| cargo --locked test --release --verbose --features uuid,url,time,chrono,option-as-array,vsock,bus-impl \ | |
| -- --skip fdpass_systemd | |
| # Test tokio support. | |
| dbus-run-session --config-file /tmp/dbus-session.conf -- \ | |
| cargo --locked test --release --verbose --tests -p zbus --no-default-features \ | |
| --features tokio-vsock -- --skip fdpass_systemd | |
| dbus-run-session --config-file /tmp/dbus-session.conf -- \ | |
| cargo --locked test --release --verbose --doc --no-default-features connection::Connection::executor | |
| # zvariant only with ostree tests (which implicitly enables `gvariant` feature too). | |
| cargo --locked t -p zvariant --features ostree-tests | |
| windows_test: | |
| runs-on: windows-latest | |
| needs: [fmt, clippy] | |
| env: | |
| RUSTFLAGS: -D warnings | |
| RUST_BACKTRACE: full | |
| RUST_LOG: trace | |
| ErrorActionPreference: Stop | |
| WarningPreference: Stop | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache Dependencies | |
| id: cache-deps | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| C:\vcpkg\installed | |
| C:\vcpkg\buildtrees | |
| C:\vcpkg\downloads | |
| key: ${{ runner.os }}-cache | |
| - name: Install vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg C:\vcpkg | |
| cd C:\vcpkg | |
| .\bootstrap-vcpkg.bat | |
| - name: Install dependencies via vcpkg | |
| shell: cmd | |
| run: | | |
| C:\vcpkg\vcpkg.exe install ^ | |
| dbus:x64-windows | |
| C:\vcpkg\vcpkg.exe integrate install | |
| echo C:\vcpkg\installed\x64-windows\tools\dbus>> %GITHUB_PATH% | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test | |
| run: | | |
| $PSNativeCommandUseErrorActionPreference = $true | |
| Start-Process C:\vcpkg\installed\x64-windows\tools\dbus\dbus-daemon.exe '--config-file=CI/win32-session.conf --address=autolaunch:' | |
| cargo --locked test | |
| # tokio feature | |
| cargo --locked test --no-default-features --features tokio | |
| # zvariant only with ostree tests (which implicitly enables `gvariant` feature too). | |
| cargo --locked t -p zvariant --features ostree-tests | |
| zvariant_fuzz: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: -D warnings | |
| RUST_BACKTRACE: full | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Fuzz zvariant | |
| run: | | |
| cargo --locked install cargo-fuzz | |
| cargo --locked fuzz run --fuzz-dir zvariant/fuzz dbus -- -max_total_time=30 -max_len=100M | |
| cargo --locked fuzz run --fuzz-dir zvariant/fuzz --features gvariant gvariant -- -max_total_time=30 -max_len=100M | |
| doc_build: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check zvariant documentation build | |
| run: cargo --locked doc --all-features -p zvariant | |
| - name: Check zbus_names documentation build | |
| run: cargo --locked doc --all-features -p zbus_names | |
| - name: Check zbus documentation build | |
| run: cargo --locked doc --all-features -p zbus | |
| - name: Check zbus_xml documentation build | |
| run: cargo --locked doc --all-features -p zbus_xml | |
| semver-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Check semver | |
| uses: obi1kenobi/cargo-semver-checks-action@v2 |