Skip to content

Commit 48c4ce6

Browse files
committed
use the dbt version instead of another flag in the CI workflows
1 parent a8be566 commit 48c4ce6

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.github/workflows/test-all-warehouses.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
warehouse-type: postgres
5858
- dbt-version: "${{ inputs.dbt-version || 'latest_pre' }}"
5959
warehouse-type: postgres
60+
- dbt-version: "${{ inputs.dbt-version || 'fusion' }}"
61+
warehouse-type: snowflake
6062
uses: ./.github/workflows/test-warehouse.yml
6163
with:
6264
warehouse-type: ${{ matrix.warehouse-type }}

.github/workflows/test-warehouse.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ on:
3131
required: false
3232
default: "latest_official"
3333
description: dbt's version to test with
34-
use-dbt-fusion:
35-
type: boolean
36-
required: false
37-
description: Use dbt-fusion to run tests
38-
default: false
3934

4035
workflow_call:
4136
inputs:
@@ -114,14 +109,14 @@ jobs:
114109
run: pip install databricks-sql-connector==2.9.3
115110

116111
- name: Install dbt
117-
if: ${{ ! inputs.use-dbt-fusion }}
112+
if: ${{ dbt-version != 'fusion' }}
118113
run:
119114
pip install${{ (inputs.dbt-version == 'latest_pre' && ' --pre') || '' }}
120115
"dbt-core${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}"
121116
"dbt-${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks') || (inputs.warehouse-type == 'spark' && 'spark[PyHive]') || (inputs.warehouse-type == 'athena' && 'athena-community') || inputs.warehouse-type }}${{ (!startsWith(inputs.dbt-version, 'latest') && format('~={0}', inputs.dbt-version)) || '' }}"
122117

123118
- name: Install dbt-fusion
124-
if: inputs.use-dbt-fusion
119+
if: inputs.dbt-version == 'fusion'
125120
run: |
126121
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh -s -- --update
127122
@@ -130,7 +125,7 @@ jobs:
130125

131126
- name: Write dbt profiles
132127
env:
133-
PROFILES_YML: ${{ (inputs.use-dbt-fusion && secrets.CI_PROFILES_YML_FUSION) || secrets.CI_PROFILES_YML }}
128+
PROFILES_YML: ${{ (inputs.dbt-version == 'fusion' && secrets.CI_PROFILES_YML_FUSION) || secrets.CI_PROFILES_YML }}
134129
run: |
135130
mkdir -p ~/.dbt
136131
DBT_VERSION=$(pip show dbt-core | grep -i version | awk '{print $2}' | sed 's/\.//g')
@@ -140,14 +135,14 @@ jobs:
140135
- name: Install dependencies
141136
working-directory: ${{ env.TESTS_DIR }}
142137
run: |
143-
${{ (inputs.use-dbt-fusion && '~/.local/bin/dbt') || 'dbt' }} deps --project-dir dbt_project
138+
${{ (inputs.dbt-version == 'fusion' && '~/.local/bin/dbt') || 'dbt' }} deps --project-dir dbt_project
144139
ln -sfn ${{ github.workspace }}/dbt-data-reliability dbt_project/dbt_packages/elementary
145140
pip install -r requirements.txt
146141
147142
- name: Check DWH connection
148143
working-directory: ${{ env.TESTS_DIR }}
149144
run: |
150-
${{ (inputs.use-dbt-fusion && '~/.local/bin/dbt') || 'dbt' }} debug -t "${{ inputs.warehouse-type }}"
145+
${{ (inputs.dbt-version == 'fusion' && '~/.local/bin/dbt') || 'dbt' }} debug -t "${{ inputs.warehouse-type }}"
151146
152147
- name: Test
153148
working-directory: "${{ env.TESTS_DIR }}/tests"

0 commit comments

Comments
 (0)