mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
fix(ci): persist all cargo-llvm-cov env vars for E2E coverage (#559)
* fix(ci): persist all cargo-llvm-cov env vars for E2E coverage Newer cargo-llvm-cov versions output CARGO_ENCODED_RUSTFLAGS instead of RUSTFLAGS from show-env. The workflow was cherry-picking specific vars (RUSTFLAGS, LLVM_PROFILE_FILE, etc.) to persist to $GITHUB_ENV, so CARGO_ENCODED_RUSTFLAGS was never set during the build step, producing a non-instrumented binary and zero .profraw files. Replace the manual echo lines with `cargo llvm-cov show-env >> $GITHUB_ENV` to forward all vars (including CARGO_ENCODED_RUSTFLAGS, CARGO_INCREMENTAL, etc.) regardless of cargo-llvm-cov version. Also forward CARGO_ENCODED_RUSTFLAGS in the E2E conftest subprocess env. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(ci): address PR review — prefix-based env forwarding, split clean step - conftest.py: replace explicit env var list with prefix-based matching (CARGO_LLVM_COV*, LLVM_*) plus specific vars (CARGO_ENCODED_RUSTFLAGS, CARGO_INCREMENTAL) to stay resilient to cargo-llvm-cov changes. - coverage.yml: move `cargo llvm-cov clean` to its own step so the env vars from show-env (persisted via $GITHUB_ENV) are active when clean runs. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3615967f92
commit
a1f0208956
@@ -102,14 +102,13 @@ jobs:
|
||||
|
||||
- name: Set up coverage instrumentation
|
||||
run: |
|
||||
source <(cargo llvm-cov show-env --export-prefix)
|
||||
# Persist env vars for subsequent steps
|
||||
echo "RUSTFLAGS=${RUSTFLAGS}" >> "$GITHUB_ENV"
|
||||
echo "LLVM_PROFILE_FILE=${LLVM_PROFILE_FILE}" >> "$GITHUB_ENV"
|
||||
echo "CARGO_LLVM_COV=1" >> "$GITHUB_ENV"
|
||||
echo "CARGO_LLVM_COV_SHOW_ENV=1" >> "$GITHUB_ENV"
|
||||
echo "CARGO_LLVM_COV_TARGET_DIR=${CARGO_LLVM_COV_TARGET_DIR}" >> "$GITHUB_ENV"
|
||||
cargo llvm-cov clean --workspace
|
||||
# Append ALL env vars from show-env (including CARGO_ENCODED_RUSTFLAGS,
|
||||
# CARGO_INCREMENTAL, LLVM_PROFILE_FILE, etc.) so the build step
|
||||
# compiles an instrumented binary regardless of cargo-llvm-cov version.
|
||||
cargo llvm-cov show-env >> "$GITHUB_ENV"
|
||||
|
||||
- name: Clean coverage workspace
|
||||
run: cargo llvm-cov clean --workspace
|
||||
|
||||
- name: Build instrumented binary
|
||||
run: cargo build --no-default-features --features libsql
|
||||
|
||||
Reference in New Issue
Block a user