Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix: workflow cache (#5050)

jif-oai85e735797366
diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml
index 846408f3a8..cbf62f72f0 100644
--- a/.github/workflows/rust-ci.yml
+++ b/.github/workflows/rust-ci.yml
@@ -148,15 +148,26 @@ jobs:
targets: ${{ matrix.target }}
components: clippy
- - uses: actions/cache@v4
+ # Explicit cache restore: split cargo home vs target, so we can
+ # avoid caching the large target dir on the gnu-dev job.
+ - name: Restore cargo home cache
+ id: cache_cargo_home_restore
+ uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
- ${{ github.workspace }}/codex-rs/target/
- key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
+ key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Restore target cache (except gnu-dev)
+ id: cache_target_restore
+ if: ${{ !(matrix.target == 'x86_64-unknown-linux-gnu' && matrix.profile != 'release') }}
+ uses: actions/cache/restore@v4
+ with:
+ path: ${{ github.workspace }}/codex-rs/target/
+ key: cargo-target-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Install musl build tools
@@ -194,6 +205,31 @@ jobs:
env:
RUST_BACKTRACE: 1
+ # Save caches explicitly; make non-fatal so cache packaging
+ # never fails the overall job. Only save when key wasn't hit.
+ - name: Save cargo home cache
+ if: always() && !cancelled() && steps.cache_cargo_home_restore.outputs.cache-hit != 'true'
+ continue-on-error: true
+ uses: actions/cache/save@v4
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Save target cache (except gnu-dev)
+ if: >-
+ always() && !cancelled() &&
+ (steps.cache_target_restore.outputs.cache-hit != 'true') &&
+ !(matrix.target == 'x86_64-unknown-linux-gnu' && matrix.profile != 'release')
+ continue-on-error: true
+ uses: actions/cache/save@v4
+ with:
+ path: ${{ github.workspace }}/codex-rs/target/
+ key: cargo-target-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
+
# Fail the job if any of the previous steps failed.
- name: verify all steps passed
if: |
diff --git a/codex-rs/core/tests/suite/unified_exec.rs b/codex-rs/core/tests/suite/unified_exec.rs
index b8c0fadbbe..cfa96dd75c 100644
--- a/codex-rs/core/tests/suite/unified_exec.rs
+++ b/codex-rs/core/tests/suite/unified_exec.rs
@@ -213,7 +213,7 @@ PY
let second_args = serde_json::json!({
"input": Vec::<String>::new(),
"session_id": "0",
- "timeout_ms": 800,
+ "timeout_ms": 2_000,
});
let responses = vec![