From 4a99e5774d65959f1dbca265b55ebd1807f0259d Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Fri, 9 Oct 2026 17:25:23 -0500 Subject: [PATCH] ci: round-trip a profile in the smoke test and run CI when the script changes --- .github/scripts/smoke.sh | 13 ++++++++++++- .github/workflows/ci.yml | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/scripts/smoke.sh b/.github/scripts/smoke.sh index 0b67559..a827a99 100755 --- a/.github/scripts/smoke.sh +++ b/.github/scripts/smoke.sh @@ -23,7 +23,18 @@ for tree in aws gcp az oci; do "$bin" "$tree" --help > /dev/null done -"$bin" config profile list -o json > /dev/null +# A profile round trip: Jackson writes it and reads it back. Listing alone proves little on a +# fresh runner, where there is nothing to read. The name is unique and the profile is deleted. +profile="floci-smoke-$$" +trap '"$bin" config profile delete "$profile" > /dev/null 2>&1 || true' EXIT +"$bin" config profile create "$profile" --container floci-smoke --port 14566 > /dev/null +shown=$("$bin" config show --profile "$profile" -o json | tr -d ' \r\n') +case "$shown" in + *'"container":"floci-smoke"'*'"port":14566'*) ;; + *) echo "::error::profile $profile did not round-trip: $shown"; exit 1 ;; +esac +"$bin" config profile list -o json | grep -q "$profile" \ + || { echo "::error::profile $profile is missing from 'config profile list'"; exit 1; } # An unknown profile is a usage error: exit 2, not a crash. set +e diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0daa03..94ad0a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,13 @@ on: - 'src/**' - 'pom.xml' - '.github/workflows/ci.yml' + - '.github/scripts/**' pull_request: paths: - 'src/**' - 'pom.xml' - '.github/workflows/ci.yml' + - '.github/scripts/**' permissions: contents: read