From d1d36fee5b6517cf63034488672fa716bd2fcca0 Mon Sep 17 00:00:00 2001 From: WHYTEWYLL Date: Thu, 6 Jul 2023 20:52:50 +0200 Subject: [PATCH] add: test workflow for aurora --- .github/workflows/dbt_test_daily.yml | 50 +++++++++++++++++++++++++++ .github/workflows/dbt_test_weekly.yml | 50 +++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 .github/workflows/dbt_test_daily.yml create mode 100644 .github/workflows/dbt_test_weekly.yml diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml new file mode 100644 index 0000000..8e0be6d --- /dev/null +++ b/.github/workflows/dbt_test_daily.yml @@ -0,0 +1,50 @@ +name: dbt_test_scheduled +run-name: dbt_test_scheduled + +on: + workflow_dispatch: + #schedule: + # Run at 1600 UTC daily (see https://crontab.guru) + #- cron: "0 9 * * *" +env: + USE_VARS: "${{ vars.USE_VARS }}" + DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" + DBT_VERSION: "${{ vars.DBT_VERSION }}" + ACCOUNT: "${{ vars.ACCOUNT }}" + ROLE: "${{ vars.ROLE }}" + USER: "${{ vars.USER }}" + PASSWORD: "${{ secrets.PASSWORD }}" + REGION: "${{ vars.REGION }}" + DATABASE: "${{ vars.DATABASE }}" + WAREHOUSE: "${{ vars.WAREHOUSE }}" + SCHEMA: "${{ vars.SCHEMA }}" + SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" + +concurrency: + group: ${{ github.workflow }} + +jobs: + run_dbt_jobs: + runs-on: ubuntu-latest + environment: + name: workflow_prod + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v1 + with: + python-version: "3.7.x" + + - name: install dependencies + run: | + pip3 install dbt-snowflake==${{ env.DBT_VERSION }} cli_passthrough requests click + dbt deps + - name: Run DBT Jobs + run: | + dbt test --exclude tag:full_test --models tag:recent_test + continue-on-error: true + + - name: Log test results + run: | + python python_scripts/test_alert/dbt_test_alert.py diff --git a/.github/workflows/dbt_test_weekly.yml b/.github/workflows/dbt_test_weekly.yml new file mode 100644 index 0000000..18ab14c --- /dev/null +++ b/.github/workflows/dbt_test_weekly.yml @@ -0,0 +1,50 @@ +name: dbt_test_scheduled +run-name: dbt_test_scheduled + +on: + workflow_dispatch: + #schedule: + # Run at 1600 UTC Monday (see https://crontab.guru) + #- cron: "0 9 * * 1" +env: + USE_VARS: "${{ vars.USE_VARS }}" + DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" + DBT_VERSION: "${{ vars.DBT_VERSION }}" + ACCOUNT: "${{ vars.ACCOUNT }}" + ROLE: "${{ vars.ROLE }}" + USER: "${{ vars.USER }}" + PASSWORD: "${{ secrets.PASSWORD }}" + REGION: "${{ vars.REGION }}" + DATABASE: "${{ vars.DATABASE }}" + WAREHOUSE: "${{ vars.WAREHOUSE }}" + SCHEMA: "${{ vars.SCHEMA }}" + SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" + +concurrency: + group: ${{ github.workflow }} + +jobs: + run_dbt_jobs: + runs-on: ubuntu-latest + environment: + name: workflow_prod + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v1 + with: + python-version: "3.7.x" + + - name: install dependencies + run: | + pip3 install dbt-snowflake==${{ env.DBT_VERSION }} cli_passthrough requests click + dbt deps + - name: Run DBT Jobs + run: | + dbt test --exclude tag:recent_test --models tag:full_test + continue-on-error: true + + - name: Log test results + run: | + python python_scripts/test_alert/dbt_test_alert.py