stellar-models/.github/workflows/dbt_test_daily.yml
Mike Stepanovic 006e314b5e
Add testing strategy (#4)
* added testing strategy

* updated recency within tests, added workflows with different lookback vars

* changed daily lookback to 1

* modified workflows to include USE_VARS in the env config, modified tests to use modified_timestamp (instead of closed_at) as the recency filter

* fixed env variables (switched to vars from secrets)

---------

Co-authored-by: Mike Stepanovic <mike.stepanovic@flipsidecrypto.com>
Co-authored-by: Eric Laurello <eric.laurello@flipsidecrypto.com>
2025-02-13 13:30:50 -07:00

48 lines
1.1 KiB
YAML

name: dbt_test_scheduled
run-name: dbt_test_scheduled
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
env:
DBT_PROFILES_DIR: ./
USE_VARS: "${{ vars.USE_VARS }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ vars.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_prod
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10.x"
cache: "pip"
- name: install dependencies
run: |
pip install -r requirements.txt
dbt deps
- name: Run DBT Jobs
run: |
dbt test -m "stellar_models,models/silver" "stellar_models,models/gold" --vars 'test_days_threshold: 1'
continue-on-error: true
- name: Log test results
run: |
python python/dbt_test_alert.py