-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (76 loc) · 2.6 KB
/
setup-stackql.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'setup stackql'
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/[email protected]
- name: Setup Stackql
uses: ./
with:
use_wrapper: ${{matrix.use_wrapper}}
- name: Get Stackql Version
id: get-stackql-version
run: |
echo "::set-output name=stackql_version::$(stackql --version)"
- name: Validate Stackql Version
run: |
# Retrieve the output from the previous step
VERSION_OUTPUT="${{ steps.get-stackql-version.outputs.stackql_version }}"
echo "Version output: $VERSION_OUTPUT"
# Regex patterns to validate different parts
SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+"
PLATFORM_REGEX="(Linux|Darwin|Windows)"
# DATE_REGEX="\b\d{4}-\d{2}-\d{2}\b"
# SHA_REGEX="\([0-9a-f]{7}\)"
# Perform validation
if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then
echo "Semantic version does not match expected format"
exit 1
fi
if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then
echo "Platform information does not match expected formats"
exit 1
fi
# if ! [[ "$VERSION_OUTPUT" =~ $DATE_REGEX ]]; then
# echo "Build date does not match expected format"
# exit 1
# fi
# if ! [[ "$VERSION_OUTPUT" =~ $SHA_REGEX ]]; then
# echo "Commit SHA does not match expected format"
# exit 1
# fi
echo "stackql --version output validated successfully."
# - name: Validate Stackql Version
# run: |
# stackql --version
# - name: Use GitHub Provider
# run: |
# stackql exec -i ./examples/github-example.iql
# env:
# STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
# STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
# - name: Use Google Provider
# run: |
# stackql exec -i ./examples/google-example.iql
# env:
# GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CREDENTIALS }}
# - name: Handle error
# if: ${{ matrix.use_wrapper}}
# continue-on-error: true
# run: | ## specify a query file that doesnt exist
# stackql exec -i ./examples/does-not-exist.iql