Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .github/workflows/setup-stackql-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,31 @@ jobs:
with:
use_wrapper: ${{matrix.use_wrapper}}

- name: Get Stackql Version
id: get-stackql-version
- name: Run Registry List
id: run-registry-list
run: |
echo "stackql_version<<EOF" >> $GITHUB_ENV
stackql --version >> $GITHUB_ENV
echo "registry_list_output<<EOF" >> $GITHUB_ENV
stackql exec "REGISTRY LIST" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Validate Stackql Version
- name: Validate Registry List
run: |
# Extract only the relevant line containing version information
VERSION_OUTPUT=$(echo "${{ env.stackql_version }}" | grep -E 'stackql v[0-9]+\.[0-9]+\.[0-9]+')
echo "Version output: $VERSION_OUTPUT"

SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+"
PLATFORM_REGEX="(Linux|Darwin|Windows|Homebrew)"

if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then
echo "Semantic version does not match expected format"
echo "Registry list output:"
echo "$registry_list_output"

# Validate header row: expect | provider | and | version | columns
# Use [[:space:]] instead of \s for macOS bash 3.2 compatibility
HEADER_REGEX='\|[[:space:]]*provider[[:space:]]*\|[[:space:]]*version[[:space:]]*\|'
if ! [[ "$registry_list_output" =~ $HEADER_REGEX ]]; then
echo "Registry list header does not match expected format"
exit 1
fi
if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then
echo "Platform information does not match expected formats"

# Validate at least one data row: | <name> | v<major>.<minor>.<patch> |
DATA_ROW_REGEX='\|[[:space:]]*[a-z][a-z0-9_]*[[:space:]]*\|[[:space:]]*v[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\|'
if ! [[ "$registry_list_output" =~ $DATA_ROW_REGEX ]]; then
echo "Registry list does not contain a valid data row"
exit 1
fi

echo "version output validated successfully."
echo "Registry list validated successfully."
7 changes: 7 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34544,6 +34544,13 @@ async function setup () {
await makeExecutable(cliPath, osPlatform);
}

// Print stackql version to action logs
const exeSuffix = osPlatform === 'win32' ? '.exe' : '';
const stackqlBin = external_path_namespaceObject.join(cliPath, `stackql${exeSuffix}`);
info('stackql version:');
const versionOutput = (0,external_child_process_namespaceObject.execSync)(`"${stackqlBin}" --version`, { encoding: 'utf-8' });
info(versionOutput.trim());

// Check if wrapper is needed and if it's not Darwin
const useWrapper = getInput('use_wrapper') === 'true';
if (useWrapper && osPlatform !== 'darwin') {
Expand Down
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ async function setup () {
await makeExecutable(cliPath, osPlatform);
}

// Print stackql version to action logs
const exeSuffix = osPlatform === 'win32' ? '.exe' : '';
const stackqlBin = path.join(cliPath, `stackql${exeSuffix}`);
core.info('stackql version:');
const versionOutput = execSync(`"${stackqlBin}" --version`, { encoding: 'utf-8' });
core.info(versionOutput.trim());

// Check if wrapper is needed and if it's not Darwin
const useWrapper = core.getInput('use_wrapper') === 'true';
if (useWrapper && osPlatform !== 'darwin') {
Expand Down