From 737dd3fa3d06e5bf70e200d7e2b261ac1f1a072f Mon Sep 17 00:00:00 2001 From: Julius Remigio <14811322+juls858@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:49:35 -0700 Subject: [PATCH] STREAM-683/workflow-bugs (#64) * set environment variables conditionally based on dispatch event abstract target to environment variable use input variable for python version * workflow fixes * Squashed commit of the following: commit 3c297e75fbcfc3c91dd820d53db5b53cea925441 Author: Julius Remigio <14811322+juls858@users.noreply.github.com> Date: Wed Oct 25 15:08:41 2023 -0700 set environment variables conditionally based on dispatch event (#63) abstract target to environment variable use input variable for python version --- .github/workflows/dbt.yml | 27 ++++++++++++++++++++++ .github/workflows/dbt_integration_test.yml | 6 ++--- .github/workflows/dbt_run_dev_refresh.yml | 2 +- .github/workflows/dbt_udf_test.yml | 4 ++-- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dbt.yml b/.github/workflows/dbt.yml index 3d3acbf..489b095 100644 --- a/.github/workflows/dbt.yml +++ b/.github/workflows/dbt.yml @@ -52,6 +52,33 @@ jobs: run: | ${{ inputs.command }} - name: Store logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: dbt-logs + path: | + logs + target + not_dispatched: + if: github.event_name != 'workflow_dispatch' + runs-on: ubuntu-latest + environment: + name: ${{ inputs.environment }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python_version }} + cache: "pip" + - name: install dependencies + run: | + pip install -r requirements.txt + dbt deps + - name: Run DBT Jobs + run: | + ${{ inputs.command }} + - name: Store logs + if: always() uses: actions/upload-artifact@v3 with: name: dbt-logs diff --git a/.github/workflows/dbt_integration_test.yml b/.github/workflows/dbt_integration_test.yml index c1c834b..7d5a85f 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -37,7 +37,7 @@ jobs: with: warehouse: ${{ vars.WAREHOUSE }} environment: hosted - command: test -s test___utils_udf_introspect + command: dbt test -s test___utils_udf_introspect prod: uses: ./.github/workflows/dbt.yml @@ -46,7 +46,7 @@ jobs: with: warehouse: ${{ vars.WAREHOUSE }} environment: prod - command: test -s test___utils_udf_introspect + command: dbt test -s test___utils_udf_introspect dispatched: uses: ./.github/workflows/dbt.yml @@ -55,4 +55,4 @@ jobs: with: warehouse: ${{ inputs.warehouse }} environment: ${{ inputs.environment }} - command: test -s test___utils_udf_introspect \ No newline at end of file + command: dbt test -s test___utils_udf_introspect \ No newline at end of file diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index 7b48359..e712a81 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -16,4 +16,4 @@ jobs: secrets: inherit with: environment: prod - command: run-operation run_sp_create_prod_clone \ No newline at end of file + command: dbt run-operation run_sp_create_prod_clone \ No newline at end of file diff --git a/.github/workflows/dbt_udf_test.yml b/.github/workflows/dbt_udf_test.yml index 238b486..92c9020 100644 --- a/.github/workflows/dbt_udf_test.yml +++ b/.github/workflows/dbt_udf_test.yml @@ -37,7 +37,7 @@ jobs: with: warehouse: ${{ vars.WAREHOUSE }} environment: prod - command: test --selector test_udfs --threads 24 + command: dbt test --selector test_udfs --threads 24 dispatched: uses: ./.github/workflows/dbt.yml @@ -46,4 +46,4 @@ jobs: with: warehouse: ${{ inputs.warehouse }} environment: ${{ inputs.environment }} - command: test --selector test_udfs --threads 24 \ No newline at end of file + command: dbt test --selector test_udfs --threads 24 \ No newline at end of file