-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 1.7 KB
/
setup-stackql-test.yml
File metadata and controls
59 lines (49 loc) · 1.7 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
47
48
49
50
51
52
53
54
55
56
57
58
59
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@v6
- name: Setup Stackql
uses: ./
with:
use_wrapper: ${{matrix.use_wrapper}}
- name: Run Registry List
id: run-registry-list
run: |
echo "registry_list_output<<EOF" >> $GITHUB_ENV
stackql exec "REGISTRY LIST" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Validate Registry List
run: |
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
# 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 "Registry list validated successfully."