From 5b3a6ad048354ee334c0ef21303ccec8f1c6ddea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 20:31:21 +0000 Subject: [PATCH 1/5] Make macOS CI runners opt-in via workflow_dispatch Remove macos-latest from the test-workspace and test-workspace-features OS matrices. Add dedicated test-workspace-macos and test-workspace-features-macos jobs that only run when the workflow is manually dispatched with run_macos: true. The new macOS jobs are intentionally excluded from the ci-gate required check so they never block merges. Fixes #843 Agent-Logs-Url: https://github.com/microsoft/DiskANN/sessions/e959ada8-d34c-4801-9a4c-27cb42d74e1d Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com> --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cd7b05fc..8c81ac541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,12 @@ on: branches: ["main"] pull_request: branches: ["main"] + workflow_dispatch: + inputs: + run_macos: + description: "Run macOS CI jobs (slow runners, opt-in)" + type: boolean + default: false name: CI @@ -371,7 +377,6 @@ jobs: - windows-latest - ubuntu-latest - ubuntu-24.04-arm - - macos-latest steps: - uses: actions/checkout@v4 @@ -403,7 +408,72 @@ jobs: os: - windows-latest - ubuntu-latest - - macos-latest + + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Install Rust + run: rustup show + + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - uses: Swatinem/rust-cache@v2 + + - name: test workspace with nextest + run: | + set -euxo pipefail + cargo nextest run --locked --workspace \ + --cargo-profile ci \ + --config "$RUST_CONFIG" \ + --features ${{ env.DISKANN_FEATURES }} + + cargo test --locked --doc --workspace --profile ci --config "$RUST_CONFIG" + + # macOS CI jobs — opt-in via workflow_dispatch. + # + # macOS GitHub-hosted runners are slow to provision, so these jobs are not + # included in the default PR / push matrix. Run them on demand by triggering + # the workflow manually with `run_macos: true`. + # + # These jobs are intentionally excluded from the `ci-gate` required check so + # they never block merges. + test-workspace-macos: + needs: basics + name: test workspace (macOS) + if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_macos == true }} + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Install Rust + run: rustup show + + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - uses: Swatinem/rust-cache@v2 + + - name: test workspace with nextest + run: | + set -euxo pipefail + cargo nextest run --locked --workspace --cargo-profile ci --config "$RUST_CONFIG" + cargo test --locked --doc --workspace --profile ci --config "$RUST_CONFIG" + + test-workspace-features-macos: + needs: basics + name: test workspace (all features, macOS) + if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_macos == true }} + runs-on: macos-latest steps: - uses: actions/checkout@v4 From 9b2d6df50e5cefd78fa5e8fb13c229f955078842 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 22:53:45 +0000 Subject: [PATCH 2/5] Compact macOS opt-in CI: use dynamic fromJSON matrix instead of duplicate jobs Replace four separate test jobs with two that dynamically include macOS in the matrix only on workflow_dispatch with run_macos=true. Removes ~66 lines of duplication while preserving identical behavior. Agent-Logs-Url: https://github.com/microsoft/DiskANN/sessions/a6dea22b-fa87-4413-8639-083eb57c8e84 Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com> --- .github/workflows/ci.yml | 80 ++++------------------------------------ 1 file changed, 7 insertions(+), 73 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c81ac541..b57bb7b2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -367,16 +367,18 @@ jobs: --package diskann-quantization \ -- --skip compile_tests + # macOS is opt-in: slow to provision, so only included when the workflow is + # manually dispatched with `run_macos: true`. On push/PR events, + # `inputs.run_macos` is null, so the condition evaluates to false and macOS + # is excluded from the matrix. macOS results are intentionally excluded from + # `ci-gate` so they never block merges. test-workspace: needs: basics name: test workspace runs-on: ${{ matrix.os }} strategy: matrix: - os: - - windows-latest - - ubuntu-latest - - ubuntu-24.04-arm + os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.run_macos && '["windows-latest","ubuntu-latest","ubuntu-24.04-arm","macos-latest"]' || '["windows-latest","ubuntu-latest","ubuntu-24.04-arm"]') }} steps: - uses: actions/checkout@v4 @@ -405,75 +407,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - windows-latest - - ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - - name: Install Rust - run: rustup show - - - name: Install cargo-nextest - uses: taiki-e/install-action@v2 - with: - tool: cargo-nextest - - - uses: Swatinem/rust-cache@v2 - - - name: test workspace with nextest - run: | - set -euxo pipefail - cargo nextest run --locked --workspace \ - --cargo-profile ci \ - --config "$RUST_CONFIG" \ - --features ${{ env.DISKANN_FEATURES }} - - cargo test --locked --doc --workspace --profile ci --config "$RUST_CONFIG" - - # macOS CI jobs — opt-in via workflow_dispatch. - # - # macOS GitHub-hosted runners are slow to provision, so these jobs are not - # included in the default PR / push matrix. Run them on demand by triggering - # the workflow manually with `run_macos: true`. - # - # These jobs are intentionally excluded from the `ci-gate` required check so - # they never block merges. - test-workspace-macos: - needs: basics - name: test workspace (macOS) - if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_macos == true }} - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - - name: Install Rust - run: rustup show - - - name: Install cargo-nextest - uses: taiki-e/install-action@v2 - with: - tool: cargo-nextest - - - uses: Swatinem/rust-cache@v2 - - - name: test workspace with nextest - run: | - set -euxo pipefail - cargo nextest run --locked --workspace --cargo-profile ci --config "$RUST_CONFIG" - cargo test --locked --doc --workspace --profile ci --config "$RUST_CONFIG" - - test-workspace-features-macos: - needs: basics - name: test workspace (all features, macOS) - if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_macos == true }} - runs-on: macos-latest + os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.run_macos && '["windows-latest","ubuntu-latest","macos-latest"]' || '["windows-latest","ubuntu-latest"]') }} steps: - uses: actions/checkout@v4 From 3e6f9d453a85405c6ac0c0b399d797e3b5e413d2 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Simhadri Date: Tue, 5 May 2026 15:52:51 -0700 Subject: [PATCH 3/5] abridged comments --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b57bb7b2e..cddbd5bc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -367,11 +367,8 @@ jobs: --package diskann-quantization \ -- --skip compile_tests - # macOS is opt-in: slow to provision, so only included when the workflow is - # manually dispatched with `run_macos: true`. On push/PR events, - # `inputs.run_macos` is null, so the condition evaluates to false and macOS - # is excluded from the matrix. macOS results are intentionally excluded from - # `ci-gate` so they never block merges. + # macOS is opt-in since it is slow to provision. + # macOS is included when the workflow is manually dispatched with `run_macos: true`. test-workspace: needs: basics name: test workspace From a402ca9456deb6e62da79b2ce4d4d08418258654 Mon Sep 17 00:00:00 2001 From: Harsha Simhadri Date: Tue, 5 May 2026 16:10:49 -0700 Subject: [PATCH 4/5] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cddbd5bc7..9da7cc453 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -368,7 +368,8 @@ jobs: -- --skip compile_tests # macOS is opt-in since it is slow to provision. - # macOS is included when the workflow is manually dispatched with `run_macos: true`. + # It is excluded from the default push/PR matrix, and only included for manually + # dispatched runs when `run_macos: true` is set. test-workspace: needs: basics name: test workspace From bb74bde0de38ffb3eea99f9e830b49c55946ce08 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Simhadri Date: Thu, 7 May 2026 16:56:02 -0700 Subject: [PATCH 5/5] remove ternary --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da7cc453..b34a06af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,10 +373,15 @@ jobs: test-workspace: needs: basics name: test workspace + if: ${{ matrix.os != 'macos-latest' || (github.event_name == 'workflow_dispatch' && inputs.run_macos) }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.run_macos && '["windows-latest","ubuntu-latest","ubuntu-24.04-arm","macos-latest"]' || '["windows-latest","ubuntu-latest","ubuntu-24.04-arm"]') }} + os: + - windows-latest + - ubuntu-latest + - ubuntu-24.04-arm + - macos-latest # skipped unless manually triggered steps: - uses: actions/checkout@v4 @@ -402,10 +407,14 @@ jobs: test-workspace-features: needs: basics name: test workspace (all features) + if: ${{ matrix.os != 'macos-latest' || (github.event_name == 'workflow_dispatch' && inputs.run_macos) }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.run_macos && '["windows-latest","ubuntu-latest","macos-latest"]' || '["windows-latest","ubuntu-latest"]') }} + os: + - windows-latest + - ubuntu-latest + - macos-latest # skipped unless manually triggered steps: - uses: actions/checkout@v4