diff --git a/scripts/docker_ci.sh b/scripts/docker_ci.sh index cd0a629..5feeea8 100755 --- a/scripts/docker_ci.sh +++ b/scripts/docker_ci.sh @@ -12,10 +12,14 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" NODE_VERSIONS=("20" "22" "24") # Use explicit npm patch versions so resolver regressions are caught. NPM_VERSIONS=("9.1.1" "9.9.4" "10.9.5" "11.6.2") - -echo -e "${YELLOW}=== Frontend Docker CI Matrix ===${NC}" -echo -e "${BLUE}Repo:${NC} $SCRIPT_DIR" -echo +EXTRA_CASES=( + "18|9.1.1" + "20|8.19.4" + "18|8.19.4" + "24|11.12.0" + "25|11.6.2" + "25|11.12.0" +) run_combo() { local node_version="$1" @@ -36,9 +40,33 @@ run_combo() { npm ci npm run build " - } +declare -a TEST_CASES=() +declare -A SEEN_CASES=() + +add_case() { + local node_version="$1" + local npm_version="$2" + local key="${node_version}|${npm_version}" + if [[ -n "${SEEN_CASES[$key]:-}" ]]; then + return + fi + SEEN_CASES["$key"]=1 + TEST_CASES+=("$key") +} + +for node_version in "${NODE_VERSIONS[@]}"; do + for npm_version in "${NPM_VERSIONS[@]}"; do + add_case "$node_version" "$npm_version" + done +done + +for case_spec in "${EXTRA_CASES[@]}"; do + IFS='|' read -r node_version npm_version <<<"$case_spec" + add_case "$node_version" "$npm_version" +done + TMP_DIR="$(mktemp -d)" declare -a JOB_PIDS=() declare -a JOB_LABELS=() @@ -50,21 +78,25 @@ cleanup() { trap cleanup EXIT -for node_version in "${NODE_VERSIONS[@]}"; do - for npm_version in "${NPM_VERSIONS[@]}"; do - label="Node ${node_version} / npm ${npm_version}" - log_file="$TMP_DIR/node-${node_version}-npm-${npm_version}.log" +echo -e "${YELLOW}=== Frontend Docker CI Matrix ===${NC}" +echo -e "${BLUE}Repo:${NC} $SCRIPT_DIR" +echo - echo -e "${BLUE}Starting:${NC} ${label}" - ( - echo -e "${YELLOW}=== ${label} ===${NC}" - run_combo "$node_version" "$npm_version" - ) >"$log_file" 2>&1 & +for case_spec in "${TEST_CASES[@]}"; do + IFS='|' read -r node_version npm_version <<<"$case_spec" + label="Node ${node_version} / npm ${npm_version}" + safe_npm="${npm_version//./-}" + log_file="$TMP_DIR/node-${node_version}-npm-${safe_npm}.log" - JOB_PIDS+=("$!") - JOB_LABELS+=("$label") - JOB_LOGS+=("$log_file") - done + echo -e "${BLUE}Starting:${NC} ${label}" + ( + echo -e "${YELLOW}=== ${label} ===${NC}" + run_combo "$node_version" "$npm_version" + ) >"$log_file" 2>&1 & + + JOB_PIDS+=("$!") + JOB_LABELS+=("$label") + JOB_LOGS+=("$log_file") done echo