1010
1111name : Adapter Integration Tests
1212
13+ run-name : " ${{ (contains(github.event_name, 'workflow_') && inputs.name) || github.event_name }}: ${{ (contains(github.event_name, 'workflow_') && inputs.adapter_branch) || github.ref_name }} by @${{ github.actor }}"
14+
1315on :
1416 push :
1517 branches :
2426
2527 workflow_dispatch :
2628 inputs :
27- dbt-core-branch :
28- description : " branch of dbt-core to use in dev-requirements.txt "
29+ name :
30+ description : " Name to associate with run (example: 'dbt-adapters-242') "
2931 required : false
3032 type : string
33+ default : " Adapter Integration Tests"
34+ adapter_branch :
35+ description : " The branch of this adapter repository to use"
36+ type : string
37+ required : false
38+ default : " main"
39+ dbt_adapters_branch :
40+ description : " The branch of dbt-adapters to use"
41+ type : string
42+ required : false
43+ default : " main"
44+ dbt_core_branch :
45+ description : " The branch of dbt-core to use"
46+ type : string
47+ required : false
48+ default : " main"
49+ dbt_common_branch :
50+ description : " The branch of dbt-common to use"
51+ type : string
52+ required : false
53+ default : " main"
3154
3255# explicitly turn off permissions for `GITHUB_TOKEN`
3356permissions : read-all
@@ -74,12 +97,19 @@ jobs:
7497 DBT_TEST_USER_3 :
" [email protected] " 7598
7699 steps :
77- - name : Check out the repository
78- if : github.event_name != 'pull_request_target '
100+ - name : Check out the repository (push)
101+ if : github.event_name == 'push '
79102 uses : actions/checkout@v4
80103 with :
81104 persist-credentials : false
82105
106+ - name : Check out the repository (workflow_dispatch)
107+ if : github.event_name == 'workflow_dispatch'
108+ uses : actions/checkout@v4
109+ with :
110+ persist-credentials : false
111+ ref : ${{ inputs.adapter_branch }}
112+
83113 # explicitly checkout the branch for the PR,
84114 # this is necessary for the `pull_request` event
85115 - name : Check out the repository (PR)
@@ -95,17 +125,20 @@ jobs:
95125 with :
96126 python-version : " 3.11"
97127
128+ - name : Update Adapters and Core branches (update dev_requirements.txt)
129+ if : github.event_name == 'workflow_dispatch'
130+ run : |
131+ ./.github/scripts/update_dev_dependency_branches.sh \
132+ ${{ inputs.dbt_adapters_branch }} \
133+ ${{ inputs.dbt_core_branch }} \
134+ ${{ inputs.dbt_common_branch }}
135+ cat dev-requirements.txt
136+
98137 - name : Install python dependencies
99138 run : |
100139 python -m pip install --user --upgrade pip
101140 python -m pip --version
102141 python -m pip install -r dagger/requirements.txt
103142
104- - name : Update dev_requirements.txt
105- if : inputs.dbt-core-branch != ''
106- run : |
107- pip install bumpversion
108- ./.github/scripts/update_dbt_core_branch.sh ${{ inputs.dbt-core-branch }}
109-
110143 - name : Run tests for ${{ matrix.test }}
111144 run : python dagger/run_dbt_spark_tests.py --profile ${{ matrix.test }}
0 commit comments