change test flow #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Running scans using latest library and the gh action on testing config and checks files. | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
soda_scan_test: | |
runs-on: ubuntu-latest | |
name: Test ${{ matrix.name }} | |
env: | |
CLOUD_API_KEY_ID: ${{ secrets.CLOUD_API_KEY_ID }} | |
CLOUD_API_KEY_SECRET: ${{ secrets.CLOUD_API_KEY_SECRET }} | |
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }} | |
SNOWFLAKE_PASS: ${{ secrets.SNOWFLAKE_PASS }} | |
strategy: | |
matrix: | |
include: | |
- name: passing scan | |
data_source: reporting_api__marts | |
checks: ./testing/checks_p*.yaml | |
expected_exit_code: 0 | |
- name: scan with check warnings | |
data_source: reporting_api__marts | |
checks: ./testing/checks_warn.yaml | |
expected_exit_code: 1 | |
- name: scan with check failures | |
data_source: reporting_api__marts | |
checks: ./testing/checks_fail.yaml | |
expected_exit_code: 2 | |
- name: scan with errors (wrong checks) | |
data_source: reporting_api__marts | |
checks: ./testing/checks_error.yaml | |
expected_exit_code: 3 | |
# Disabled until https://github.com/sodadata/soda-library/pull/63 is merged and released | |
# - name: scan with errors (wrong data source) | |
# data_source: MISSING_DS | |
# checks: ./testing/checks_pass.yaml | |
# expected_exit_code: 3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Perform Soda Scan | |
id: soda_scan | |
continue-on-error: true | |
uses: ./ | |
with: | |
soda_library_version: v1.0.6 | |
configuration: ./testing/configuration.yaml | |
data_source: ${{ matrix.data_source }} | |
checks: ${{ matrix.checks }} | |
- name: Assert scan exit code | |
run: | | |
if [ "${{ env.SCAN_EXIT_CODE }}" == "${{ matrix.expected_exit_code }}" ]; then | |
echo "The Scan exited as expected." | |
else | |
echo "The Scan did not exit as expected." | |
exit 1 | |
fi |