Skip to content

Commit ab55df9

Browse files
committed
ci: set up validation test
1 parent 3961ad0 commit ab55df9

File tree

7 files changed

+223
-47
lines changed

7 files changed

+223
-47
lines changed

.github/workflows/dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
runs-on: ubuntu-latest
4141

4242
steps:
43-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
with:
4545
fetch-depth: 0
4646
persist-credentials: false
4747

48-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
48+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4949
with:
5050
cache-dependency-path: go/go.sum
5151
check-latest: true

.github/workflows/dev_pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: ubuntu-slim
4444

4545
steps:
46-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
46+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4747
with:
4848
fetch-depth: 1
4949
persist-credentials: false

.github/workflows/generate.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
# limitations under the License.
1414

1515
driver = "databricks"
16+
environment = "azure-prod"
1617

1718
[lang]
1819
go = true
20+
21+
[secrets]
22+
DATABRICKS_HOST = { secret = "DATABRICKS_HOST", contexts = ["validate"] }
23+
DATABRICKS_ACCESSTOKEN = { secret = "DATABRICKS_TOKEN", contexts = ["validate"] }
24+
DATABRICKS_HTTPPATH = { secret = "TEST_PECO_WAREHOUSE_HTTP_PATH", contexts = ["validate"] }

.github/workflows/go_release.yaml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ on:
3737

3838
workflow_dispatch: {}
3939

40-
4140
concurrency:
4241
# Must share concurrency group with release workflow since it also builds/tests
4342
group: ${{ github.repository }}-${{ github.ref }}-ci
@@ -58,6 +57,7 @@ jobs:
5857
- { platform: linux, arch: amd64, runner: ubuntu-latest }
5958
- { platform: macos, arch: arm64, runner: macos-latest }
6059
- { platform: win, arch: amd64, runner: windows-latest }
60+
environment: azure-prod
6161
permissions:
6262
contents: read
6363
steps:
@@ -68,12 +68,12 @@ jobs:
6868
# https://github.com/actions/runner-images/issues/2840
6969
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
7070
71-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
71+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7272
with:
7373
fetch-depth: 0
7474
persist-credentials: false
7575

76-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
76+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
7777
with:
7878
cache-dependency-path: go/go.sum
7979
check-latest: true
@@ -118,11 +118,6 @@ jobs:
118118
fi
119119
set +a
120120
121-
if [[ -n "${{ secrets.environment }}" ]]; then
122-
echo "Loading secret environment variables"
123-
eval "${{ secrets.environment }}"
124-
fi
125-
126121
if [[ -f ci/scripts/pre-test.sh ]]; then
127122
echo "Loading pre-test"
128123
./ci/scripts/pre-test.sh
@@ -155,6 +150,7 @@ jobs:
155150
include:
156151
# I think we only need to test one platform, but we can change that later
157152
- { platform: linux, arch: amd64, runner: ubuntu-latest }
153+
environment: azure-prod
158154
permissions:
159155
contents: read
160156
steps:
@@ -165,12 +161,12 @@ jobs:
165161
# https://github.com/actions/runner-images/issues/2840
166162
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
167163
168-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
164+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
169165
with:
170166
fetch-depth: 0
171167
persist-credentials: false
172168

173-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
169+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
174170
with:
175171
cache-dependency-path: go/go.sum
176172
check-latest: true
@@ -212,6 +208,10 @@ jobs:
212208
213209
- name: Validate
214210
if: runner.os == 'Linux'
211+
env:
212+
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
213+
DATABRICKS_ACCESSTOKEN: ${{ secrets.DATABRICKS_TOKEN }}
214+
DATABRICKS_HTTPPATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
215215
working-directory: go
216216
run: |
217217
set -a
@@ -223,11 +223,6 @@ jobs:
223223
fi
224224
set +a
225225
226-
if [[ -n "${{ secrets.environment }}" ]]; then
227-
echo "Loading secret environment variables"
228-
eval "${{ secrets.environment }}"
229-
fi
230-
231226
if [[ -f ci/scripts/pre-test.sh ]]; then
232227
echo "Loading pre-test"
233228
./ci/scripts/pre-test.sh
@@ -268,12 +263,12 @@ jobs:
268263
packages: read
269264

270265
steps:
271-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
266+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
272267
with:
273268
fetch-depth: 0
274269
persist-credentials: false
275270

276-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
271+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
277272
with:
278273
cache-dependency-path: go/go.sum
279274
check-latest: true
@@ -321,12 +316,12 @@ jobs:
321316
contents: read
322317

323318
steps:
324-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
319+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
325320
with:
326321
fetch-depth: 0
327322
persist-credentials: false
328323

329-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
324+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
330325
with:
331326
check-latest: true
332327
go-version: "stable"
@@ -388,12 +383,12 @@ jobs:
388383
contents: write
389384

390385
steps:
391-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
386+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
392387
with:
393388
fetch-depth: 0
394389
persist-credentials: false
395390

396-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
391+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
397392
with:
398393
check-latest: true
399394
go-version: "stable"

.github/workflows/go_test.yaml

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,23 @@ on:
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

4560
concurrency:
4661
# Must share concurrency group with release workflow since it also builds/tests
@@ -62,6 +77,7 @@ jobs:
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

Comments
 (0)