@@ -29,7 +29,7 @@ permissions:
2929
3030jobs :
3131 test :
32- name : " Rust SDK Tests"
32+ name : " Rust SDK Tests (${{ matrix.os }}, default) "
3333 if : github.event.repository.fork == false
3434 env :
3535 POWERSHELL_UPDATECHECK : Off
8484 # Share the bundled-CLI archive cache with the `bundle` job: build.rs
8585 # now downloads in both modes (embed for `bundle`, extract-to-cache
8686 # for this `test` job's `--no-default-features` build).
87- - name : Cache bundled CLI tarball
87+ - name : Cache bundled CLI archives
8888 uses : actions/cache@v4
8989 with :
9090 path : ./rust/.bundled-cli-cache
9898 if : runner.os == 'Linux'
9999 env :
100100 BUNDLED_CLI_CACHE_DIR : ${{ github.workspace }}/rust/.bundled-cli-cache
101- run : cargo clippy --all-targets --features test-support -- --no-deps -D warnings -D clippy::unwrap_used -D clippy::disallowed_macros -D clippy::await_holding_invalid_type
101+ run : cargo clippy --all-targets --features test-support,bundled-in-process -- --no-deps -D warnings -D clippy::unwrap_used -D clippy::disallowed_macros -D clippy::await_holding_invalid_type
102102
103103 - name : cargo doc
104104 if : runner.os == 'Linux'
@@ -129,14 +129,92 @@ jobs:
129129 # The dedicated `bundle` job below exercises the embed pipeline.
130130 run : cargo test --no-default-features --features test-support -- --test-threads=4 --nocapture
131131
132+ # Exercises the in-process FFI transport (`Transport::InProcess`, the Rust
133+ # analogue of the .NET `RuntimeConnection.ForInProcess()`), mirroring the
134+ # `inprocess` transport cell in dotnet-sdk-tests.yml. Sets
135+ # COPILOT_SDK_DEFAULT_CONNECTION=inprocess so the client hosts the runtime
136+ # cdylib in-process instead of spawning a stdio child, then runs the whole
137+ # E2E suite over the in-process transport. The suite runs serially in-process
138+ # (the harness forces concurrency to 1) because it mirrors each test's
139+ # environment onto the shared process environment the in-process worker inherits.
140+ # Runs the whole E2E suite over the in-process transport on supported hosts.
141+ test-inprocess :
142+ name : " Rust SDK Tests (${{ matrix.os }}, inprocess)"
143+ if : github.event.repository.fork == false
144+ env :
145+ CARGO_TERM_COLOR : always
146+ RUST_BACKTRACE : 1
147+ strategy :
148+ fail-fast : false
149+ matrix :
150+ # TODO: Re-enable Windows after fixing the napi-oop peer shutdown crash.
151+ os : [ubuntu-latest, macos-latest]
152+ runs-on : ${{ matrix.os }}
153+ defaults :
154+ run :
155+ shell : bash
156+ working-directory : ./rust
157+ steps :
158+ - uses : actions/checkout@v6.0.2
159+
160+ - uses : ./.github/actions/setup-copilot
161+ id : setup-copilot
162+
163+ - name : Install Rust toolchain
164+ uses : dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
165+ with :
166+ toolchain : " 1.94.0"
167+
168+ - uses : Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
169+ with :
170+ workspaces : " rust"
171+ prefix-key : v1-rust-no-bin
172+ cache-bin : false
173+
174+ - name : Read pinned @github/copilot CLI version
175+ id : cli-version
176+ working-directory : ./nodejs
177+ run : |
178+ version=$(node -p "require('./package-lock.json').packages['node_modules/@github/copilot'].version")
179+ echo "version=$version" >> "$GITHUB_OUTPUT"
180+ echo "Pinned CLI version: $version"
181+
182+ - name : Cache bundled CLI archives
183+ uses : actions/cache@v4
184+ with :
185+ path : ./rust/.bundled-cli-cache
186+ key : bundled-cli-${{ matrix.os }}-${{ steps.cli-version.outputs.version }}
187+
188+ - name : Install test harness dependencies
189+ working-directory : ./test/harness
190+ run : npm ci --ignore-scripts
191+
192+ - name : Warm up PowerShell
193+ if : runner.os == 'Windows'
194+ run : pwsh.exe -Command "Write-Host 'PowerShell ready'"
195+
196+ - name : Select in-process transport
197+ run : echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
198+
199+ - name : cargo test (in-process transport, full E2E suite)
200+ timeout-minutes : 60
201+ env :
202+ COPILOT_HMAC_KEY : ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
203+ COPILOT_CLI_PATH : ${{ steps.setup-copilot.outputs.cli-path }}
204+ BUNDLED_CLI_CACHE_DIR : ${{ github.workspace }}/rust/.bundled-cli-cache
205+ # The harness forces serial execution in-process (both the async semaphore and
206+ # libtest via --test-threads=1) because it mirrors each test's environment onto
207+ # the shared process environment, so RUST_E2E_CONCURRENCY is not set here.
208+ run : cargo test --no-default-features --features test-support,bundled-in-process --test e2e -- --test-threads=1 --nocapture
209+
132210 # Validates the bundled-CLI build path on all three supported
133211 # platforms. While the regular `cargo test` job above also exercises
134212 # build.rs (bundling is on by default now), this matrix job is the
135213 # dedicated cross-platform smoke test for the download / verify /
136214 # extract / embed pipeline. Catches regressions before they ship to
137215 # crates.io and before bundling consumers hit them downstream.
138216 bundle :
139- name : " Rust SDK Bundled CLI Build"
217+ name : " Rust SDK Bundled CLI Build (${{ matrix.os }}) "
140218 if : github.event.repository.fork == false
141219 env :
142220 CARGO_TERM_COLOR : always
@@ -180,13 +258,15 @@ jobs:
180258 # ~130 MB on every CI invocation. Keyed by OS + CLI version so old
181259 # archives drop out when the pinned version bumps, keeping the
182260 # cache bounded.
183- - name : Cache bundled CLI tarball
261+ - name : Cache bundled CLI archives
184262 uses : actions/cache@v4
185263 with :
186264 path : ./rust/.bundled-cli-cache
187265 key : bundled-cli-${{ matrix.os }}-${{ steps.cli-version.outputs.version }}
188266
189- - name : cargo build ( bundled-cli is the default feature)
267+ - name : Test bundled CLI build paths
190268 env :
191269 BUNDLED_CLI_CACHE_DIR : ${{ github.workspace }}/rust/.bundled-cli-cache
192- run : cargo build
270+ run : |
271+ cargo build
272+ cargo test --features bundled-in-process --lib embedded_archive_contains_only_expected_files
0 commit comments