-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.45 KB
/
setup-stackql-test.yml
File metadata and controls
46 lines (38 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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."