Repository navigation
279 lines (234 loc) · 10.2 KB
/
Copy pathpr-checks.yml
File metadata and controls
279 lines (234 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# Copyright (c) 2026 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Per-PR build / format / lint / unit-test gate. Runs on every PR
# against `main` and on every push to `main`. Mirrors the
# `code-quality-checks` workflow in databricks/databricks-sql-python
# and the `prCheck` workflow in databricks/databricks-jdbc.
name: PR Checks
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
# The `protect-main` ruleset enables a merge queue and lists this
# workflow's "Unit + doc tests" job as a required status check.
# GitHub re-evaluates required checks against the merge-group ref,
# so without this trigger the queue entry hangs until
# `check_response_timeout_minutes` expires. The sibling jobs
# (Formatting / Clippy / Build (tls-rustls feature)) also run on the
# merge group — they are advisory, not required, so the extra runs
# are harmless and keep the workflow trigger simple.
merge_group:
concurrency:
# pull_request: coalesce per head_ref (PR branch).
# merge_group: head_ref is empty, so fall back to github.ref (the
# unique gh-readonly-queue ref) — distinct queue entries stay
# separate.
# push to main: head_ref is also empty, but falling back to
# github.ref ("refs/heads/main") would make cancel-in-progress
# cancel the previous main push's in-flight CI. Pin to github.sha
# on push so each landed commit keeps its own isolated run.
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
fmt:
name: Formatting
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Test install-log URL redaction
run: bash .github/actions/install-bot-engine/redact-command-output_test.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
components: rustfmt
- name: cargo fmt --check
run: |
cargo +stable fmt --all -- --check
cargo +stable fmt --manifest-path adbc/Cargo.toml -- --check
clippy:
name: Clippy
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
components: clippy
- name: Setup sccache
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
test:
name: Unit + doc tests
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
- name: Setup sccache
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: cargo test
# Runs every test the default suite executes: unit tests,
# doc tests, and wiremock-backed integration tests. Does NOT
# run the v0_*_e2e suites — those are #[ignore]'d and require
# a live workspace; `rust-e2e.yml` runs them separately.
run: cargo test --workspace
c-abi:
name: C ABI smoke test
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
- name: Setup sccache
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: make c-abi-test
# Builds the cdylib and compiles + runs the hand-written C smoke
# tests in tests/c/ against the C ABI exported from src/c_abi/.
# Hermetic (no live warehouse) — proves ODBC / Go consumers can
# link and call the kernel. `cc` is preinstalled on the runner.
run: make c-abi-test
adbc:
name: ADBC native + C ABI
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: 1.89.0
components: clippy
- name: Setup sccache
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Test native Rust and ADBC C ABI surfaces
working-directory: adbc
run: |
cargo clippy --all-targets --features ffi -- -D warnings
cargo test --features ffi
- name: Build and dynamically load the ADBC driver
working-directory: adbc
run: |
cargo build --release --features ffi --lib --example ffi_smoke
./target/release/examples/ffi_smoke "$PWD/target/release/libdatabricks_adbc.so"
- name: Verify package contents
working-directory: adbc
run: cargo package --allow-dirty --list
check-tls-rustls:
name: Build (tls-rustls feature)
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
components: clippy
- name: Setup sccache
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: cargo check (tls-rustls)
# Default features pull in `tls-native`; the napi binding crate
# opts INTO `tls-rustls` instead. Without this job, a feature-
# gated cfg typo or a dep update that breaks rustls compilation
# would only surface when the downstream napi build breaks.
run: cargo check -p databricks-sql-kernel --no-default-features --features tls-rustls
- name: cargo clippy (tls-rustls)
# Keep clippy honest under both backends so warnings caught
# under tls-native don't disappear under tls-rustls and vice
# versa.
run: cargo clippy -p databricks-sql-kernel --no-default-features --features tls-rustls --all-targets -- -D warnings
- name: Test client behavior (tls-rustls)
run: "cargo test -p databricks-sql-kernel --no-default-features --features tls-rustls --lib client::"
windows-revocation:
# The Windows-only revocation module (`client::tls_revocation`) and its tests compile
# only on Windows, so the Linux jobs above never build or run them. Same runner label
# and toolchain setup as the Windows job in `release-debuginfo.yml`.
name: Windows revocation (tls-rustls)
runs-on:
group: databricks-protected-runner-group
labels: [windows-server-latest]
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable
components: clippy
- name: Set up MSVC environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
with:
arch: x64
# pwsh, not the runner's default bash: Git Bash puts Git's coreutils `link` ahead of
# MSVC's `link.exe` on PATH, which breaks linking (as `release-debuginfo.yml` avoids).
- name: cargo clippy (tls-rustls, Windows)
shell: pwsh
run: cargo clippy -p databricks-sql-kernel --no-default-features --features tls-rustls --all-targets -- -D warnings
- name: Test client behavior (tls-rustls, Windows)
shell: pwsh
# Two runs: the client:: suite, then the C ABI revocation open test, which is not under client::.
run: |
cargo test -p databricks-sql-kernel --no-default-features --features tls-rustls --lib client::
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cargo test -p databricks-sql-kernel --no-default-features --features tls-rustls --lib c_abi::session::revocation_open_windows_tests