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
4459
4560concurrency :
4661 # Must share concurrency group with release workflow since it also builds/tests
6277 - { platform: linux, arch: amd64, runner: ubuntu-latest }
6378 - { platform: macos, arch: arm64, runner: macos-latest }
6479 - { platform: win, arch: amd64, runner: windows-latest }
80+ environment : azure-prod
6581 permissions :
6682 contents : read
6783 steps :
@@ -72,12 +88,22 @@ jobs:
7288 # https://github.com/actions/runner-images/issues/2840
7389 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
7490
75- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
91+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
92+ if : github.event_name != 'workflow_dispatch'
7693 with :
7794 fetch-depth : 0
7895 persist-credentials : false
7996
80- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
97+ - name : " checkout remote"
98+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99+ if : github.event_name == 'workflow_dispatch'
100+ with :
101+ repository : ${{ inputs.repository }}
102+ ref : ${{ inputs.ref }}
103+ fetch-depth : 0
104+ persist-credentials : false
105+
106+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
81107 with :
82108 cache-dependency-path : go/go.sum
83109 check-latest : true
@@ -122,11 +148,6 @@ jobs:
122148 fi
123149 set +a
124150
125- if [[ -n "${{ secrets.environment }}" ]]; then
126- echo "Loading secret environment variables"
127- eval "${{ secrets.environment }}"
128- fi
129-
130151 if [[ -f ci/scripts/pre-test.sh ]]; then
131152 echo "Loading pre-test"
132153 ./ci/scripts/pre-test.sh
@@ -159,6 +180,7 @@ jobs:
159180 include :
160181 # I think we only need to test one platform, but we can change that later
161182 - { platform: linux, arch: amd64, runner: ubuntu-latest }
183+ environment : azure-prod
162184 permissions :
163185 contents : read
164186 steps :
@@ -169,12 +191,22 @@ jobs:
169191 # https://github.com/actions/runner-images/issues/2840
170192 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
171193
172- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
194+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
195+ if : github.event_name != 'workflow_dispatch'
173196 with :
174197 fetch-depth : 0
175198 persist-credentials : false
176199
177- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
200+ - name : " checkout remote"
201+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
202+ if : github.event_name == 'workflow_dispatch'
203+ with :
204+ repository : ${{ inputs.repository }}
205+ ref : ${{ inputs.ref }}
206+ fetch-depth : 0
207+ persist-credentials : false
208+
209+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
178210 with :
179211 cache-dependency-path : go/go.sum
180212 check-latest : true
@@ -216,6 +248,10 @@ jobs:
216248
217249 - name : Validate
218250 if : runner.os == 'Linux'
251+ env :
252+ DATABRICKS_HOST : ${{ secrets.DATABRICKS_HOST }}
253+ DATABRICKS_ACCESSTOKEN : ${{ secrets.DATABRICKS_TOKEN }}
254+ DATABRICKS_HTTPPATH : ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
219255 working-directory : go
220256 run : |
221257 set -a
@@ -227,11 +263,6 @@ jobs:
227263 fi
228264 set +a
229265
230- if [[ -n "${{ secrets.environment }}" ]]; then
231- echo "Loading secret environment variables"
232- eval "${{ secrets.environment }}"
233- fi
234-
235266 if [[ -f ci/scripts/pre-test.sh ]]; then
236267 echo "Loading pre-test"
237268 ./ci/scripts/pre-test.sh
@@ -272,12 +303,22 @@ jobs:
272303 packages : read
273304
274305 steps :
275- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
306+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
307+ if : github.event_name != 'workflow_dispatch'
276308 with :
277309 fetch-depth : 0
278310 persist-credentials : false
279311
280- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
312+ - name : " checkout remote"
313+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
314+ if : github.event_name == 'workflow_dispatch'
315+ with :
316+ repository : ${{ inputs.repository }}
317+ ref : ${{ inputs.ref }}
318+ fetch-depth : 0
319+ persist-credentials : false
320+
321+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
281322 with :
282323 cache-dependency-path : go/go.sum
283324 check-latest : true
@@ -325,12 +366,22 @@ jobs:
325366 contents : read
326367
327368 steps :
328- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
369+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
370+ if : github.event_name != 'workflow_dispatch'
329371 with :
330372 fetch-depth : 0
331373 persist-credentials : false
332374
333- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
375+ - name : " checkout remote"
376+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
377+ if : github.event_name == 'workflow_dispatch'
378+ with :
379+ repository : ${{ inputs.repository }}
380+ ref : ${{ inputs.ref }}
381+ fetch-depth : 0
382+ persist-credentials : false
383+
384+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
334385 with :
335386 check-latest : true
336387 go-version : " stable"
@@ -392,12 +443,22 @@ jobs:
392443 contents : read
393444
394445 steps :
395- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
446+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
447+ if : github.event_name != 'workflow_dispatch'
448+ with :
449+ fetch-depth : 0
450+ persist-credentials : false
451+
452+ - name : " checkout remote"
453+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
454+ if : github.event_name == 'workflow_dispatch'
396455 with :
456+ repository : ${{ inputs.repository }}
457+ ref : ${{ inputs.ref }}
397458 fetch-depth : 0
398459 persist-credentials : false
399460
400- - uses : actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1 .0
461+ - uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2 .0
401462 with :
402463 check-latest : true
403464 go-version : " stable"
0 commit comments