Skip to content

Commit e8ff82b

Browse files
committed
updated test
1 parent 40dc783 commit e8ff82b

1 file changed

Lines changed: 57 additions & 18 deletions

File tree

.github/workflows/setup-stackql.yml

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,64 @@ jobs:
2929
with:
3030
use_wrapper: ${{matrix.use_wrapper}}
3131

32-
- name: Validate Stackql Version
32+
- name: Get Stackql Version
33+
id: get-stackql-version
3334
run: |
34-
stackql --version
35+
echo "::set-output name=stackql_version::$(stackql --version)"
3536
36-
- name: Use GitHub Provider
37+
- name: Validate Stackql Version
3738
run: |
38-
stackql exec -i ./examples/github-example.iql
39-
env:
40-
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
41-
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
39+
# Retrieve the output from the previous step
40+
VERSION_OUTPUT="${{ steps.get-stackql-version.outputs.stackql_version }}"
41+
echo "Version output: $VERSION_OUTPUT"
42+
43+
# Regex patterns to validate different parts
44+
SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+"
45+
PLATFORM_REGEX="(Linux|Darwin|Windows)"
46+
DATE_REGEX="\b\d{4}-\d{2}-\d{2}\b"
47+
SHA_REGEX="\([0-9a-f]{7}\)"
48+
49+
# Perform validation
50+
if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then
51+
echo "Semantic version does not match expected format"
52+
exit 1
53+
fi
54+
if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then
55+
echo "Platform information does not match expected formats"
56+
exit 1
57+
fi
58+
if ! [[ "$VERSION_OUTPUT" =~ $DATE_REGEX ]]; then
59+
echo "Build date does not match expected format"
60+
exit 1
61+
fi
62+
if ! [[ "$VERSION_OUTPUT" =~ $SHA_REGEX ]]; then
63+
echo "Commit SHA does not match expected format"
64+
exit 1
65+
fi
66+
67+
echo "All components of the version output are validated successfully."
68+
69+
70+
71+
# - name: Validate Stackql Version
72+
# run: |
73+
# stackql --version
74+
75+
# - name: Use GitHub Provider
76+
# run: |
77+
# stackql exec -i ./examples/github-example.iql
78+
# env:
79+
# STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
80+
# STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
4281

43-
- name: Use Google Provider
44-
run: |
45-
stackql exec -i ./examples/google-example.iql
46-
env:
47-
GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CREDENTIALS }}
48-
49-
- name: Handle error
50-
if: ${{ matrix.use_wrapper}}
51-
continue-on-error: true
52-
run: | ## specify a query file that doesnt exist
53-
stackql exec -i ./examples/does-not-exist.iql
82+
# - name: Use Google Provider
83+
# run: |
84+
# stackql exec -i ./examples/google-example.iql
85+
# env:
86+
# GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CREDENTIALS }}
87+
88+
# - name: Handle error
89+
# if: ${{ matrix.use_wrapper}}
90+
# continue-on-error: true
91+
# run: | ## specify a query file that doesnt exist
92+
# stackql exec -i ./examples/does-not-exist.iql

0 commit comments

Comments
 (0)