mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-30 17:05:21 -05:00
ci: round-trip a profile in the smoke test and run CI when the script changes
This commit is contained in:
2 files changed
+14
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user