Skip to content

Commit 7accc79

Browse files
committed
print stackql version in action logs and update test to validate registry list
- index.js: run stackql --version after setup and log output to action logs (runs before wrapper install to use the original binary name) - workflow: replace version check test with stackql exec REGISTRY LIST test that validates the JSON response is an array of {provider, version} objects https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa
1 parent afabba2 commit 7accc79

3 files changed

Lines changed: 21 additions & 24 deletions

File tree

.github/workflows/setup-stackql-test.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,12 @@ jobs:
2929
with:
3030
use_wrapper: ${{matrix.use_wrapper}}
3131

32-
- name: Get Stackql Version
33-
id: get-stackql-version
32+
- name: Run Registry List and Validate
3433
run: |
35-
echo "stackql_version<<EOF" >> $GITHUB_ENV
36-
stackql --version >> $GITHUB_ENV
37-
echo "EOF" >> $GITHUB_ENV
34+
OUTPUT=$(stackql exec --output json "REGISTRY LIST")
35+
echo "Registry list output:"
36+
echo "$OUTPUT"
3837
39-
- name: Validate Stackql Version
40-
run: |
41-
# Extract only the relevant line containing version information
42-
VERSION_OUTPUT=$(echo "${{ env.stackql_version }}" | grep -E 'stackql v[0-9]+\.[0-9]+\.[0-9]+')
43-
echo "Version output: $VERSION_OUTPUT"
44-
45-
SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+"
46-
PLATFORM_REGEX="(Linux|Darwin|Windows|Homebrew)"
47-
48-
if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then
49-
echo "Semantic version does not match expected format"
50-
exit 1
51-
fi
52-
if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then
53-
echo "Platform information does not match expected formats"
54-
exit 1
55-
fi
56-
57-
echo "version output validated successfully."
38+
# Validate JSON structure: array of objects each with provider and version keys
39+
echo "$OUTPUT" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null
40+
echo "Registry list validated successfully."

dist/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34544,6 +34544,13 @@ async function setup () {
3454434544
await makeExecutable(cliPath, osPlatform);
3454534545
}
3454634546

34547+
// Print stackql version to action logs
34548+
const exeSuffix = osPlatform === 'win32' ? '.exe' : '';
34549+
const stackqlBin = external_path_namespaceObject.join(cliPath, `stackql${exeSuffix}`);
34550+
info('stackql version:');
34551+
const versionOutput = (0,external_child_process_namespaceObject.execSync)(`"${stackqlBin}" --version`, { encoding: 'utf-8' });
34552+
info(versionOutput.trim());
34553+
3454734554
// Check if wrapper is needed and if it's not Darwin
3454834555
const useWrapper = getInput('use_wrapper') === 'true';
3454934556
if (useWrapper && osPlatform !== 'darwin') {

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ async function setup () {
118118
await makeExecutable(cliPath, osPlatform);
119119
}
120120

121+
// Print stackql version to action logs
122+
const exeSuffix = osPlatform === 'win32' ? '.exe' : '';
123+
const stackqlBin = path.join(cliPath, `stackql${exeSuffix}`);
124+
core.info('stackql version:');
125+
const versionOutput = execSync(`"${stackqlBin}" --version`, { encoding: 'utf-8' });
126+
core.info(versionOutput.trim());
127+
121128
// Check if wrapper is needed and if it's not Darwin
122129
const useWrapper = core.getInput('use_wrapper') === 'true';
123130
if (useWrapper && osPlatform !== 'darwin') {

0 commit comments

Comments
 (0)