From df2de9ae707232fee1e661846cfd12e969b07577 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 11:20:43 +0200 Subject: [PATCH 1/6] ci: use less ci resources --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2858c003..d926f48c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,13 +5,15 @@ name: CI on: push: - branches: ["**"] + branches: ["main", "release/*", "!release/dry-run/*"] pull_request: branches: ["**"] - schedule: - - cron: "0 6 * * 1-5" workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check: runs-on: ubuntu-latest From a1e5e0407f8cdb9e080d24e49bd1db8ea2108b04 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 11:21:29 +0200 Subject: [PATCH 2/6] ci: pin actions to their SHA --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d926f48c..6e4d0ce3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,15 +19,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone this repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true - name: Run isort - uses: isort/isort-action@v1 + uses: isort/isort-action@24d8a7a51d33ca7f36c3f23598dafa33f7071326 # v1.1.1 - name: Run black - uses: psf/black@stable + uses: psf/black@87928e6d6761a4a6d22250e1fee5601b3998086e # v26.5.1 with: options: "--check --diff -C" @@ -63,17 +63,17 @@ jobs: - "3.13-dev" steps: - name: Clone this repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - name: Build zenoh-python - uses: messense/maturin-action@v1 + uses: messense/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 - name: Install zenoh-python run: pip3 install ./target/wheels/*.whl @@ -93,8 +93,8 @@ jobs: markdown_lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: DavidAnson/markdownlint-cli2-action@v18 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0 with: config: '.markdownlint.yaml' globs: '**/README.md' From c122e88a496b32c7a8feeeb67b7da706b19b6b16 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 12:41:53 +0200 Subject: [PATCH 3/6] chore: rely on rust-toolchain.toml for cargo --- .github/workflows/ci.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e4d0ce3..a9e83da3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,23 +31,16 @@ jobs: with: options: "--check --diff -C" - - name: Update Stable Rust toolchain - run: rustup update stable - - - name: Install rust components - run: | - rustup +stable component add clippy rustfmt - - name: Run rustfmt - run: cargo +stable fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" + run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" - name: Clippy no-default-features - run: cargo +stable clippy --no-default-features --all-targets -- --deny warnings + run: cargo clippy --no-default-features --all-targets -- --deny warnings - name: Clippy with all features and without Cargo.lock run: | rm Cargo.lock - cargo +stable clippy --all-features --all-targets -- --deny warnings + cargo clippy --all-features --all-targets -- --deny warnings build: needs: check From 100b6070ba0950edae741988d28c02ba4b724259 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 16:52:38 +0200 Subject: [PATCH 4/6] ci: cache Rust builds in Python matrix --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9e83da3..52fa9dd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,8 @@ jobs: build: needs: check runs-on: ubuntu-latest + env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse strategy: fail-fast: false matrix: @@ -65,6 +67,17 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Cache Cargo + uses: actions/cache@0057852bfaa89a56745cba8c7299d2fc39830 # v4.3.0 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.toml', 'Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-cargo- + - name: Build zenoh-python uses: messense/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 From e4ec495571c0e91312e6a704b5374608d4125c59 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 16:57:27 +0200 Subject: [PATCH 5/6] ci: warm Rust cache from check job --- .github/workflows/ci.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52fa9dd6..22b4148c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ concurrency: jobs: check: runs-on: ubuntu-latest + env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse steps: - name: Clone this repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -31,6 +33,12 @@ jobs: with: options: "--check --diff -C" + - name: Cache Rust dependencies and build artifacts + uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + with: + workspaces: ". -> target" + shared-key: linux-zenoh-python + - name: Run rustfmt run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" @@ -67,16 +75,11 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Cache Cargo - uses: actions/cache@0057852bfaa89a56745cba8c7299d2fc39830 # v4.3.0 + - name: Cache Rust dependencies and build artifacts + uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.toml', 'Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-cargo- + workspaces: ". -> target" + shared-key: linux-zenoh-python - name: Build zenoh-python uses: messense/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 From c1399e0c8a35a5bfda7c04dc9fd64b8c29661a8a Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Tue, 1 Sep 2026 12:46:56 +0200 Subject: [PATCH 6/6] chore: add rustfmt and clippy to rust-toolchain.toml --- rust-toolchain.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 72436043..8565ca6b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] channel = "1.97.1" +components = ["rustfmt", "clippy"]