print stackql version in action logs and update test to validate regi… #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'setup stackql test' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'develop-**' | |
| pull_request: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| stackql-test-matrix: | |
| name: Stackql local run on ${{ matrix.os }} ${{ matrix.use_wrapper && 'with' || 'without' }} wrapper | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| use_wrapper: [true, false] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.1.4 | |
| - name: Setup Stackql | |
| uses: ./ | |
| with: | |
| use_wrapper: ${{matrix.use_wrapper}} | |
| - name: Run Registry List and Validate | |
| run: | | |
| OUTPUT=$(stackql exec --output json "REGISTRY LIST") | |
| echo "Registry list output:" | |
| echo "$OUTPUT" | |
| # When the wrapper is active, @actions/exec also prints the command line before the | |
| # output, and core.debug() appends ::debug:: annotations immediately after the JSON | |
| # (on the same line, since the JSON has no trailing newline). Strip workflow commands | |
| # and then keep only lines that look like JSON (starting with [ or {). | |
| CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -E '^\s*[\[{]') | |
| # Validate JSON structure: array of objects each with provider and version keys | |
| echo "$CLEAN_JSON" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null | |
| echo "Registry list validated successfully." |