Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Apr 26, 2024
1 parent 40dc783 commit e8ff82b
Showing 1 changed file with 57 additions and 18 deletions.
75 changes: 57 additions & 18 deletions .github/workflows/setup-stackql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,64 @@ jobs:
with:
use_wrapper: ${{matrix.use_wrapper}}

- name: Validate Stackql Version
- name: Get Stackql Version
id: get-stackql-version
run: |
stackql --version
echo "::set-output name=stackql_version::$(stackql --version)"
- name: Use GitHub Provider
- name: Validate Stackql Version
run: |
stackql exec -i ./examples/github-example.iql
env:
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
# 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 "All components of the version output are 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
# - 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

0 comments on commit e8ff82b

Please sign in to comment.