Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ jobs:
}

ensure_r_runtime() {
if command -v Rscript >/dev/null 2>&1; then
if command -v Rscript >/dev/null 2>&1 && dpkg -s libcurl4-openssl-dev libssl-dev libxml2-dev >/dev/null 2>&1; then
return 0
fi
run_and_capture "R runtime install (r-base)" \
bash -c 'sudo apt-get update && sudo apt-get install -y r-base'
run_and_capture "R runtime install (r-base and package headers)" \
bash -c 'sudo apt-get update && sudo apt-get install -y r-base libcurl4-openssl-dev libssl-dev libxml2-dev'
}

run_r_test_coverage() {
Expand All @@ -572,7 +572,7 @@ jobs:
export R_LIBS_USER="${RUNNER_TEMP}/R-library"
mkdir -p "$R_LIBS_USER"
run_and_capture "R coverage tooling (covr/testthat)" \
Rscript -e 'repos <- "https://cloud.r-project.org"; dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE, showWarnings = FALSE); .libPaths(c(Sys.getenv("R_LIBS_USER"), .libPaths())); for (pkg in c("covr", "testthat")) if (!requireNamespace(pkg, quietly = TRUE)) install.packages(pkg, repos = repos, lib = Sys.getenv("R_LIBS_USER"))'
Rscript -e 'repos <- "https://cloud.r-project.org"; lib <- Sys.getenv("R_LIBS_USER"); dir.create(lib, recursive = TRUE, showWarnings = FALSE); .libPaths(c(lib, .libPaths())); required <- c("covr", "testthat"); for (pkg in required) if (!requireNamespace(pkg, quietly = TRUE)) install.packages(pkg, repos = repos, lib = lib, dependencies = TRUE); missing <- required[!vapply(required, requireNamespace, logical(1), quietly = TRUE)]; if (length(missing)) stop("R coverage tooling packages unavailable after install: ", paste(missing, collapse = ", "))'
if [ -f DESCRIPTION ]; then
run_and_capture "R package coverage with missing-line report" \
Rscript -e 'cov <- covr::package_coverage(); print(cov); zero <- covr::zero_coverage(cov); if (NROW(zero) > 0) { print(zero); stop("R coverage below 100%; add tests for the listed files/lines.") }'
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci/test_strix_quick_gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ assert_opencode_review_uses_codegraph_and_gpt5_fallback() {
assert_file_contains "$workflow_file" "Checkout trusted OpenCode review workflow" "opencode review checks out central trusted workflow scripts before processing PR data"
assert_file_contains "$workflow_file" "Checkout trusted OpenCode coverage contract" "opencode coverage job uses central trusted coverage tooling instead of target-repo copies"
assert_file_contains "$workflow_file" 'R_LIBS_USER="${RUNNER_TEMP}/R-library"' "opencode R coverage installs packages into a writable runner user library"
assert_file_contains "$workflow_file" 'install.packages(pkg, repos = repos, lib = Sys.getenv("R_LIBS_USER"))' "opencode R coverage avoids unwritable system R library installs"
assert_file_contains "$workflow_file" 'install.packages(pkg, repos = repos, lib = lib' "opencode R coverage avoids unwritable system R library installs"
assert_file_contains "$workflow_file" "libcurl4-openssl-dev libssl-dev libxml2-dev" "opencode R coverage installs system headers required by covr dependencies"
assert_file_contains "$workflow_file" "dependencies = TRUE" "opencode R coverage installs transitive package dependencies for covr/testthat"
assert_file_contains "$workflow_file" "R coverage tooling packages unavailable after install" "opencode R coverage verifies covr/testthat are loadable after installation"
assert_file_contains "$workflow_file" "repository: ContextualWisdomLab/.github" "opencode required workflow checks out the central source repository"
assert_file_contains "$workflow_file" 'ref: ${{ steps.trusted_source.outputs.ref }}' "opencode required workflow checks out the resolved central ref"
assert_file_contains "$workflow_file" "target_repository:" "opencode workflow_dispatch can target a repository whose PR does not inherit required workflows"
Expand Down