5151 default : " latest_official"
5252 required : false
5353
54+ permissions : {}
55+
5456env :
5557 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
5658 TESTS_DIR : ${{ github.workspace }}/dbt-data-reliability/integration_tests
5961 test :
6062 runs-on : ubuntu-latest
6163 timeout-minutes : 60
64+ permissions :
65+ contents : read
66+ env :
67+ WAREHOUSE : ${{ inputs.warehouse-type }}
68+ DBT_VERSION : ${{ inputs.dbt-version }}
6269 concurrency :
6370 # Serialises runs for the same warehouse × dbt-version × branch.
6471 # The schema name is derived from a hash of this group (see "Write dbt profiles").
@@ -160,22 +167,26 @@ jobs:
160167
161168 - name : Install dbt-vertica
162169 if : inputs.warehouse-type == 'vertica' && inputs.dbt-version != 'fusion'
170+ env :
171+ DBT_CORE_PIN : ${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}
163172 run : |
164173 # dbt-vertica pins dbt-core~=1.8 which lacks native support for the
165174 # "arguments" test property used by the integration-test framework.
166175 # Install dbt-vertica without deps, then install the requested
167176 # dbt-core version separately (dbt-vertica works fine with newer
168177 # dbt-core versions).
169178 pip install dbt-vertica --no-deps
170- pip install vertica-python \
171- "dbt-core${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}"
179+ pip install vertica-python "dbt-core${DBT_CORE_PIN}"
172180
173181 - name : Install dbt
174182 if : ${{ inputs.dbt-version != 'fusion' && inputs.warehouse-type != 'vertica' }}
175- run :
176- pip install${{ (inputs.dbt-version == 'latest_pre' && ' --pre') || '' }}
177- " dbt-core${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}"
178- " 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)) || '' }}"
183+ env :
184+ PIP_PRE_FLAG : ${{ (inputs.dbt-version == 'latest_pre' && '--pre') || '' }}
185+ DBT_CORE_PIN : ${{ (!startsWith(inputs.dbt-version, 'latest') && format('=={0}', inputs.dbt-version)) || '' }}
186+ DBT_ADAPTER_PKG : ${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks') || (inputs.warehouse-type == 'spark' && 'spark[PyHive]') || (inputs.warehouse-type == 'athena' && 'athena-community') || inputs.warehouse-type }}
187+ DBT_ADAPTER_PIN : ${{ (!startsWith(inputs.dbt-version, 'latest') && format('~={0}', inputs.dbt-version)) || '' }}
188+ run : |
189+ pip install $PIP_PRE_FLAG "dbt-core${DBT_CORE_PIN}" "dbt-${DBT_ADAPTER_PKG}${DBT_ADAPTER_PIN}"
179190
180191 - name : Install dbt-fusion
181192 if : inputs.dbt-version == 'fusion'
@@ -187,11 +198,17 @@ jobs:
187198 # For Vertica, dbt-vertica is already installed with --no-deps above;
188199 # using ".[vertica]" would re-resolve dbt-vertica's deps and downgrade
189200 # dbt-core to ~=1.8. Install elementary without the adapter extra.
190- if [ "${{ inputs.warehouse-type }}" = "vertica" ]; then
191- pip install "./elementary"
192- else
193- pip install "./elementary[${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks') || inputs.warehouse-type }}]"
194- fi
201+ case "$WAREHOUSE" in
202+ vertica)
203+ pip install "./elementary"
204+ ;;
205+ databricks_catalog)
206+ pip install "./elementary[databricks]"
207+ ;;
208+ *)
209+ pip install "./elementary[$WAREHOUSE]"
210+ ;;
211+ esac
195212
196213 - name : Write dbt profiles
197214 env :
@@ -205,7 +222,7 @@ jobs:
205222 # Budget (PostgreSQL 63-char limit):
206223 # dbt_(4) + timestamp(13) + _(1) + branch(≤18) + _(1) + hash(8) = 45
207224 # + _elementary(11) + _gw7(4) = 60
208- CONCURRENCY_GROUP="tests_${{ inputs.warehouse-type }} _dbt_${{ inputs.dbt-version } }_${BRANCH_NAME}"
225+ CONCURRENCY_GROUP="tests_${WAREHOUSE} _dbt_${DBT_VERSION }_${BRANCH_NAME}"
209226 SHORT_HASH=$(echo -n "$CONCURRENCY_GROUP" | sha256sum | head -c 8)
210227 SAFE_BRANCH=$(echo "${BRANCH_NAME}" | awk '{print tolower($0)}' | sed "s/[^a-z0-9]/_/g; s/__*/_/g" | head -c 18)
211228 DATE_STAMP=$(date -u +%y%m%d_%H%M%S)
@@ -221,8 +238,9 @@ jobs:
221238 - name : Install dependencies
222239 working-directory : ${{ env.TESTS_DIR }}
223240 run : |
224- ${{ (inputs.dbt-version == 'fusion' && '~/.local/bin/dbt') || 'dbt' }} deps --project-dir dbt_project
225- ln -sfn ${{ github.workspace }}/dbt-data-reliability dbt_project/dbt_packages/elementary
241+ if [ "$DBT_VERSION" = "fusion" ]; then DBT_BIN="$HOME/.local/bin/dbt"; else DBT_BIN="dbt"; fi
242+ "$DBT_BIN" deps --project-dir dbt_project
243+ ln -sfn "${{ github.workspace }}/dbt-data-reliability" dbt_project/dbt_packages/elementary
226244 pip install -r requirements.txt
227245
228246 - name : Start Vertica
@@ -240,15 +258,24 @@ jobs:
240258 - name : Check DWH connection
241259 working-directory : ${{ env.TESTS_DIR }}
242260 run : |
243- ${{ (inputs.dbt-version == 'fusion' && '~/.local/bin/dbt') || 'dbt' }} debug -t "${{ inputs.warehouse-type }}"
261+ if [ "$DBT_VERSION" = "fusion" ]; then DBT_BIN="$HOME/.local/bin/dbt"; else DBT_BIN="dbt"; fi
262+ "$DBT_BIN" debug -t "$WAREHOUSE"
244263
245264 - name : Test
246265 working-directory : " ${{ env.TESTS_DIR }}/tests"
247- run : py.test -n${{ (inputs.warehouse-type == 'spark' && '4') || '8' }} -vvv --target "${{ inputs.warehouse-type }}" --junit-xml=test-results.xml --html=detailed_report_${{ inputs.warehouse-type }}_dbt_${{ inputs.dbt-version }}.html --self-contained-html --clear-on-end ${{ (inputs.dbt-version == 'fusion' && '--runner-method fusion') || '' }}
266+ env :
267+ PYTEST_PARALLEL : ${{ (inputs.warehouse-type == 'spark' && '4') || '8' }}
268+ FUSION_RUNNER_FLAG : ${{ (inputs.dbt-version == 'fusion' && '--runner-method fusion') || '' }}
269+ run : |
270+ py.test -n"$PYTEST_PARALLEL" -vvv --target "$WAREHOUSE" \
271+ --junit-xml=test-results.xml \
272+ --html="detailed_report_${WAREHOUSE}_dbt_${DBT_VERSION}.html" \
273+ --self-contained-html --clear-on-end $FUSION_RUNNER_FLAG
248274
249275 - name : Upload test results
250276 if : always()
251- uses : pmeier/pytest-results-action@v0.8.0
277+ # pmeier/pytest-results-action v0.8.0, checked 2026-04-26.
278+ uses : pmeier/pytest-results-action@0841ca7226ab155943837380769373a5dd14d7ed
252279 with :
253280 path : ${{ env.TESTS_DIR }}/tests/test-results.xml
254281 summary : true
@@ -269,6 +296,7 @@ jobs:
269296 working-directory : ${{ env.TESTS_DIR }}
270297 continue-on-error : true
271298 run : |
272- ${{ (inputs.dbt-version == 'fusion' && '~/.local/bin/dbt') || 'dbt' }} run-operation elementary_tests.drop_test_schemas \
299+ if [ "$DBT_VERSION" = "fusion" ]; then DBT_BIN="$HOME/.local/bin/dbt"; else DBT_BIN="dbt"; fi
300+ "$DBT_BIN" run-operation elementary_tests.drop_test_schemas \
273301 --project-dir dbt_project \
274- -t "${{ inputs.warehouse-type }} "
302+ -t "$WAREHOUSE "
0 commit comments