print stackql version in action logs and update test to validate regi… #16
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 writes stackql's stdout directly to the | |
| # wrapper process's stdout, and core.debug() appends ::debug:: annotations immediately | |
| # after (on the same line, since the JSON has no trailing newline). Strip all GitHub | |
| # Actions workflow commands (::name::value) before handing the output to jq. | |
| CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -v '^[[:space:]]*$') | |
| # 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." |