diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b042b8816..15878c310 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,13 +2,16 @@ name: Rust native app # Pull request checks for rust/: format, lint, tests, the headless # self-check and a windowed smoke test, all on the debug build so each job -# compiles wxWidgets once. Release builds and packaging live in -# rust-build.yml. +# compiles wxWidgets once. Pushes to dev run the same checks and seed the +# debug caches that pull requests restore. Release builds and packaging live +# in rust-build.yml. on: pull_request: paths: ["rust/**", ".github/workflows/rust.yml"] push: + branches: [dev] + paths: ["rust/**", ".github/workflows/rust.yml"] tags: ["v*"] workflow_dispatch: @@ -39,8 +42,9 @@ jobs: steps: - uses: actions/checkout@v4 with: - # The CHANGELOG gate compares against the base branch. - fetch-depth: ${{ matrix.os == 'ubuntu-latest' && 0 || 1 }} + # The CHANGELOG gate compares against the base branch. Quoted: a bare 0 + # is falsy in expressions, so `&& 0 || 1` always picked 1. + fetch-depth: ${{ matrix.os == 'ubuntu-latest' && '0' || '1' }} - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy @@ -49,6 +53,9 @@ jobs: workspaces: rust shared-key: debug-${{ runner.os }} cache-on-failure: false + # Only dev saves, so pull requests restore its cache instead of + # uploading their own. + save-if: ${{ github.ref == 'refs/heads/dev' }} - name: Linux build dependencies if: runner.os == 'Linux' diff --git a/rust/crates/aw-ai/src/transport.rs b/rust/crates/aw-ai/src/transport.rs index b19ce19e2..52fe931fa 100644 --- a/rust/crates/aw-ai/src/transport.rs +++ b/rust/crates/aw-ai/src/transport.rs @@ -486,7 +486,7 @@ mod tests { steps.push(Step::Send(sse_chunk(None, None, Some(usage)))); steps.push(Step::Send(b"data: [DONE]\n\n".to_vec())); let server = TestServer::start(vec![Reply::sse(steps)]); - let result = stream(&server, limits(0.5, 0.5, 10.0)).unwrap(); + let result = stream(&server, limits(0.5, 1.0, 10.0)).unwrap(); assert_eq!( result, ChatStream {