3939 - " go/**"
4040 - .github/workflows/go_test.yaml
4141
42- workflow_dispatch : {}
43-
42+ workflow_call :
43+ inputs :
44+ repository :
45+ description : " The repository to checkout (in owner/repo short format)"
46+ required : true
47+ type : string
48+ ref :
49+ description : " The ref to checkout"
50+ required : true
51+ type : string
52+ secrets :
53+ DATABRICKS_HOST :
54+ required : true
55+ DATABRICKS_TOKEN :
56+ required : true
57+ TEST_PECO_WAREHOUSE_HTTP_PATH :
58+ required : true
59+ DATABRICKS_TEST_CLIENT_ID :
60+ required : true
61+ DATABRICKS_TEST_CLIENT_SECRET :
62+ required : true
4463
4564concurrency :
4665 # Must share concurrency group with release workflow since it also builds/tests
6281 - { platform: linux, arch: amd64, runner: ubuntu-latest }
6382 - { platform: macos, arch: arm64, runner: macos-latest }
6483 - { platform: win, arch: amd64, runner: windows-latest }
84+ environment : azure-prod
6585 permissions :
6686 contents : read
6787 steps :
@@ -72,12 +92,22 @@ jobs:
7292 # https://github.com/actions/runner-images/issues/2840
7393 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
7494
75- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
95+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
96+ if : github.event_name != 'workflow_dispatch'
7697 with :
7798 fetch-depth : 0
7899 persist-credentials : false
79100
80- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
101+ - name : " checkout remote"
102+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
103+ if : github.event_name == 'workflow_dispatch'
104+ with :
105+ repository : ${{ inputs.repository }}
106+ ref : ${{ inputs.ref }}
107+ fetch-depth : 0
108+ persist-credentials : false
109+
110+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
81111 with :
82112 cache-dependency-path : go/go.sum
83113 check-latest : true
@@ -122,11 +152,6 @@ jobs:
122152 fi
123153 set +a
124154
125- if [[ -n "${{ secrets.environment }}" ]]; then
126- echo "Loading secret environment variables"
127- eval "${{ secrets.environment }}"
128- fi
129-
130155 if [[ -f ci/scripts/pre-test.sh ]]; then
131156 echo "Loading pre-test"
132157 ./ci/scripts/pre-test.sh
@@ -159,6 +184,7 @@ jobs:
159184 include :
160185 # I think we only need to test one platform, but we can change that later
161186 - { platform: linux, arch: amd64, runner: ubuntu-latest }
187+ environment : azure-prod
162188 permissions :
163189 contents : read
164190 steps :
@@ -169,12 +195,22 @@ jobs:
169195 # https://github.com/actions/runner-images/issues/2840
170196 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
171197
172- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
198+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
199+ if : github.event_name != 'workflow_dispatch'
173200 with :
174201 fetch-depth : 0
175202 persist-credentials : false
176203
177- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
204+ - name : " checkout remote"
205+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
206+ if : github.event_name == 'workflow_dispatch'
207+ with :
208+ repository : ${{ inputs.repository }}
209+ ref : ${{ inputs.ref }}
210+ fetch-depth : 0
211+ persist-credentials : false
212+
213+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
178214 with :
179215 cache-dependency-path : go/go.sum
180216 check-latest : true
@@ -216,6 +252,12 @@ jobs:
216252
217253 - name : Validate
218254 if : runner.os == 'Linux'
255+ env :
256+ DATABRICKS_HOST : ${{ secrets.DATABRICKS_HOST }}
257+ DATABRICKS_ACCESSTOKEN : ${{ secrets.DATABRICKS_TOKEN }}
258+ DATABRICKS_HTTPPATH : ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
259+ DATABRICKS_OAUTH_CLIENT_ID : ${{ secrets.DATABRICKS_TEST_CLIENT_ID }}
260+ DATABRICKS_OAUTH_CLIENT_SECRET : ${{ secrets.DATABRICKS_TEST_CLIENT_SECRET }}
219261 working-directory : go
220262 run : |
221263 set -a
@@ -227,11 +269,6 @@ jobs:
227269 fi
228270 set +a
229271
230- if [[ -n "${{ secrets.environment }}" ]]; then
231- echo "Loading secret environment variables"
232- eval "${{ secrets.environment }}"
233- fi
234-
235272 if [[ -f ci/scripts/pre-test.sh ]]; then
236273 echo "Loading pre-test"
237274 ./ci/scripts/pre-test.sh
@@ -272,12 +309,22 @@ jobs:
272309 packages : read
273310
274311 steps :
275- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
312+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
313+ if : github.event_name != 'workflow_dispatch'
276314 with :
277315 fetch-depth : 0
278316 persist-credentials : false
279317
280- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
318+ - name : " checkout remote"
319+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
320+ if : github.event_name == 'workflow_dispatch'
321+ with :
322+ repository : ${{ inputs.repository }}
323+ ref : ${{ inputs.ref }}
324+ fetch-depth : 0
325+ persist-credentials : false
326+
327+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
281328 with :
282329 cache-dependency-path : go/go.sum
283330 check-latest : true
@@ -325,12 +372,22 @@ jobs:
325372 contents : read
326373
327374 steps :
328- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
375+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
376+ if : github.event_name != 'workflow_dispatch'
329377 with :
330378 fetch-depth : 0
331379 persist-credentials : false
332380
333- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
381+ - name : " checkout remote"
382+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
383+ if : github.event_name == 'workflow_dispatch'
384+ with :
385+ repository : ${{ inputs.repository }}
386+ ref : ${{ inputs.ref }}
387+ fetch-depth : 0
388+ persist-credentials : false
389+
390+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
334391 with :
335392 check-latest : true
336393 go-version : " stable"
@@ -392,12 +449,22 @@ jobs:
392449 contents : read
393450
394451 steps :
395- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
452+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
453+ if : github.event_name != 'workflow_dispatch'
454+ with :
455+ fetch-depth : 0
456+ persist-credentials : false
457+
458+ - name : " checkout remote"
459+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
460+ if : github.event_name == 'workflow_dispatch'
396461 with :
462+ repository : ${{ inputs.repository }}
463+ ref : ${{ inputs.ref }}
397464 fetch-depth : 0
398465 persist-credentials : false
399466
400- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1 .0
467+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2 .0
401468 with :
402469 check-latest : true
403470 go-version : " stable"
0 commit comments