Skip to content

Commit e461ed8

Browse files
authored
Merge pull request #30 from stackql/claude/update-node-dependencies-wRhWa
print stackql version in action logs and update test to validate regi…
2 parents fd26990 + c06ca6b commit e461ed8

3 files changed

Lines changed: 33 additions & 17 deletions

File tree

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,31 @@ 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
33+
id: run-registry-list
3434
run: |
35-
echo "stackql_version<<EOF" >> $GITHUB_ENV
36-
stackql --version >> $GITHUB_ENV
35+
echo "registry_list_output<<EOF" >> $GITHUB_ENV
36+
stackql exec "REGISTRY LIST" >> $GITHUB_ENV
3737
echo "EOF" >> $GITHUB_ENV
3838
39-
- name: Validate Stackql Version
39+
- name: Validate Registry List
4040
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"
41+
echo "Registry list output:"
42+
echo "$registry_list_output"
43+
44+
# Validate header row: expect | provider | and | version | columns
45+
# Use [[:space:]] instead of \s for macOS bash 3.2 compatibility
46+
HEADER_REGEX='\|[[:space:]]*provider[[:space:]]*\|[[:space:]]*version[[:space:]]*\|'
47+
if ! [[ "$registry_list_output" =~ $HEADER_REGEX ]]; then
48+
echo "Registry list header does not match expected format"
5049
exit 1
5150
fi
52-
if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then
53-
echo "Platform information does not match expected formats"
51+
52+
# Validate at least one data row: | <name> | v<major>.<minor>.<patch> |
53+
DATA_ROW_REGEX='\|[[:space:]]*[a-z][a-z0-9_]*[[:space:]]*\|[[:space:]]*v[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\|'
54+
if ! [[ "$registry_list_output" =~ $DATA_ROW_REGEX ]]; then
55+
echo "Registry list does not contain a valid data row"
5456
exit 1
5557
fi
5658
57-
echo "version output validated successfully."
59+
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)