9797 - 'dbt/**'
9898 - 'tests/**'
9999 - 'dev-requirements.txt'
100- bigquery-python:
101- - 'dbt/adapters/bigquery/dataproc/**'
102- - 'dbt/adapters/bigquery/python_submissions.py'
103- - 'dbt/include/bigquery/python_model/**'
104100
105101 - name : Generate integration test matrix
106102 id : generate-matrix
@@ -192,21 +188,6 @@ jobs:
192188 GCS_BUCKET : dbt-ci
193189 run : tox -- --ddtrace
194190
195- # python models tests are slow so we only want to run them if we're changing them
196- - name : Run tox (python models)
197- if : needs.test-metadata.outputs.run-python-tests == 'true'
198- env :
199- BIGQUERY_TEST_SERVICE_ACCOUNT_JSON : ${{ secrets.BIGQUERY_TEST_SERVICE_ACCOUNT_JSON }}
200- BIGQUERY_TEST_ALT_DATABASE : ${{ secrets.BIGQUERY_TEST_ALT_DATABASE }}
201- BIGQUERY_TEST_NO_ACCESS_DATABASE : ${{ secrets.BIGQUERY_TEST_NO_ACCESS_DATABASE }}
202- DBT_TEST_USER_1 :
group:[email protected] 203- DBT_TEST_USER_2 :
group:[email protected] 204- DBT_TEST_USER_3 :
serviceAccount:[email protected] 205- DATAPROC_REGION : us-central1
206- DATAPROC_CLUSTER_NAME : dbt-test-1
207- GCS_BUCKET : dbt-ci
208- run : tox -e python-tests -- --ddtrace
209-
210191 - uses : actions/upload-artifact@v3
211192 if : always()
212193 with :
@@ -225,10 +206,67 @@ jobs:
225206 name : integration_results_${{ matrix.python-version }}_${{ matrix.os }}_${{ matrix.adapter }}-${{ steps.date.outputs.date }}.csv
226207 path : integration_results.csv
227208
209+ # python integration tests are slow so we only run them seperately and for a single OS / python version
210+ test-python :
211+ name : " test-python"
212+ needs : test-metadata
213+ runs-on : ubuntu-latest
214+ if : >-
215+ needs.test-metadata.outputs.matrix &&
216+ fromJSON( needs.test-metadata.outputs.matrix ).include[0] &&
217+ (
218+ github.event_name != 'pull_request_target' ||
219+ github.event.pull_request.head.repo.full_name == github.repository ||
220+ contains(github.event.pull_request.labels.*.name, 'ok to test')
221+ )
222+
223+ steps :
224+ - name : Check out the repository
225+ if : github.event_name != 'pull_request_target'
226+ uses : actions/checkout@v3
227+ with :
228+ persist-credentials : false
229+
230+ # explicitly checkout the branch for the PR,
231+ # this is necessary for the `pull_request_target` event
232+ - name : Check out the repository (PR)
233+ if : github.event_name == 'pull_request_target'
234+ uses : actions/checkout@v3
235+ with :
236+ persist-credentials : false
237+ ref : ${{ github.event.pull_request.head.sha }}
238+
239+ - name : Set up Python 3.8
240+ uses : actions/setup-python@v4
241+ with :
242+ python-version : " 3.8"
243+
244+ - name : Install python dependencies
245+ run : |
246+ python -m pip install --user --upgrade pip
247+ python -m pip install tox
248+ python -m pip --version
249+ tox --version
250+
251+ - name : Run tox (python models)
252+ env :
253+ BIGQUERY_TEST_SERVICE_ACCOUNT_JSON : ${{ secrets.BIGQUERY_TEST_SERVICE_ACCOUNT_JSON }}
254+ BIGQUERY_TEST_ALT_DATABASE : ${{ secrets.BIGQUERY_TEST_ALT_DATABASE }}
255+ BIGQUERY_TEST_NO_ACCESS_DATABASE : ${{ secrets.BIGQUERY_TEST_NO_ACCESS_DATABASE }}
256+ DBT_TEST_USER_1 :
group:[email protected] 257+ DBT_TEST_USER_2 :
group:[email protected] 258+ DBT_TEST_USER_3 :
serviceAccount:[email protected] 259+ DATAPROC_REGION : us-central1
260+ DATAPROC_CLUSTER_NAME : dbt-test-1
261+ GCS_BUCKET : dbt-ci
262+ run : tox -e python-tests -- --ddtrace
263+
228264 require-label-comment :
229265 runs-on : ubuntu-latest
230266
231- needs : test
267+ needs :
268+ - test
269+ - test-python
232270
233271 permissions :
234272 pull-requests : write
0 commit comments