mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-10 02:33:04 +02:00
Expand docker version testing coverage. Closes #84.
This commit is contained in:
+50
-18
@@ -12,10 +12,14 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|||||||
NODE_VERSIONS=("20" "22" "24")
|
NODE_VERSIONS=("20" "22" "24")
|
||||||
# Use explicit npm patch versions so resolver regressions are caught.
|
# Use explicit npm patch versions so resolver regressions are caught.
|
||||||
NPM_VERSIONS=("9.1.1" "9.9.4" "10.9.5" "11.6.2")
|
NPM_VERSIONS=("9.1.1" "9.9.4" "10.9.5" "11.6.2")
|
||||||
|
EXTRA_CASES=(
|
||||||
echo -e "${YELLOW}=== Frontend Docker CI Matrix ===${NC}"
|
"18|9.1.1"
|
||||||
echo -e "${BLUE}Repo:${NC} $SCRIPT_DIR"
|
"20|8.19.4"
|
||||||
echo
|
"18|8.19.4"
|
||||||
|
"24|11.12.0"
|
||||||
|
"25|11.6.2"
|
||||||
|
"25|11.12.0"
|
||||||
|
)
|
||||||
|
|
||||||
run_combo() {
|
run_combo() {
|
||||||
local node_version="$1"
|
local node_version="$1"
|
||||||
@@ -36,9 +40,33 @@ run_combo() {
|
|||||||
npm ci
|
npm ci
|
||||||
npm run build
|
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)"
|
TMP_DIR="$(mktemp -d)"
|
||||||
declare -a JOB_PIDS=()
|
declare -a JOB_PIDS=()
|
||||||
declare -a JOB_LABELS=()
|
declare -a JOB_LABELS=()
|
||||||
@@ -50,21 +78,25 @@ cleanup() {
|
|||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
for node_version in "${NODE_VERSIONS[@]}"; do
|
echo -e "${YELLOW}=== Frontend Docker CI Matrix ===${NC}"
|
||||||
for npm_version in "${NPM_VERSIONS[@]}"; do
|
echo -e "${BLUE}Repo:${NC} $SCRIPT_DIR"
|
||||||
label="Node ${node_version} / npm ${npm_version}"
|
echo
|
||||||
log_file="$TMP_DIR/node-${node_version}-npm-${npm_version}.log"
|
|
||||||
|
|
||||||
echo -e "${BLUE}Starting:${NC} ${label}"
|
for case_spec in "${TEST_CASES[@]}"; do
|
||||||
(
|
IFS='|' read -r node_version npm_version <<<"$case_spec"
|
||||||
echo -e "${YELLOW}=== ${label} ===${NC}"
|
label="Node ${node_version} / npm ${npm_version}"
|
||||||
run_combo "$node_version" "$npm_version"
|
safe_npm="${npm_version//./-}"
|
||||||
) >"$log_file" 2>&1 &
|
log_file="$TMP_DIR/node-${node_version}-npm-${safe_npm}.log"
|
||||||
|
|
||||||
JOB_PIDS+=("$!")
|
echo -e "${BLUE}Starting:${NC} ${label}"
|
||||||
JOB_LABELS+=("$label")
|
(
|
||||||
JOB_LOGS+=("$log_file")
|
echo -e "${YELLOW}=== ${label} ===${NC}"
|
||||||
done
|
run_combo "$node_version" "$npm_version"
|
||||||
|
) >"$log_file" 2>&1 &
|
||||||
|
|
||||||
|
JOB_PIDS+=("$!")
|
||||||
|
JOB_LABELS+=("$label")
|
||||||
|
JOB_LOGS+=("$log_file")
|
||||||
done
|
done
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user