Repository navigation
ci: full CI/CD pipeline matching peer SQL driver repos #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # 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. | ||
|
|
||
| # Port of databricks/databricks-jdbc's closeStale.yml. Closes issues | ||
| # and PRs after 30 days of inactivity (with a 7-day stale window). | ||
|
|
||
| name: Close stale issues and PRs | ||
|
|
||
| on: | ||
| schedule: | ||
| # 06:30 UTC daily | ||
| - cron: "30 6 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| stale: | ||
| runs-on: | ||
| group: databricks-protected-runner-group | ||
| labels: linux-ubuntu-latest | ||
| steps: | ||
| - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8 | ||
| with: | ||
| stale-issue-message: "This issue has been marked as Stale because it has been open for 30 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue." | ||
| stale-pr-message: "This PR has been marked as Stale because it has been open for 30 days with no activity. If you would like the PR to remain open, please remove the stale label or comment on the PR." | ||
| close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale." | ||
| close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." | ||
| days-before-stale: 30 | ||
| days-before-close: 7 | ||
| exempt-issue-labels: "epic, discussion, kernel-v0, tracked" | ||
| exempt-pr-labels: "kernel-v0, tracked" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # 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. | ||
|
|
||
| # Code coverage report. Runs `cargo llvm-cov` against the unit / | ||
| # integration test suite (E2E tests stay #[ignore]'d) and uploads | ||
| # the lcov result to Codecov via OIDC. | ||
|
|
||
| name: Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| pull-requests: write | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| coverage: | ||
| name: Coverage | ||
| runs-on: | ||
| group: databricks-protected-runner-group | ||
| labels: linux-ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 | ||
| with: | ||
| toolchain: stable | ||
| components: llvm-tools-preview | ||
|
|
||
| - name: Install cargo-llvm-cov | ||
| uses: taiki-e/install-action@a416ddeedbd372e614cc1386e8b642692f66865e # v2.57.1 | ||
| with: | ||
| tool: cargo-llvm-cov | ||
|
|
||
| - name: Run coverage | ||
| # E2E tests stay #[ignore]'d; coverage runs the same suite | ||
| # as `pr-checks.yml`'s `test` job. | ||
| run: cargo llvm-cov --workspace --lcov --output-path lcov.info | ||
|
|
||
| # Codecov upload. | ||
| # | ||
| # `use_oidc: true` is tokenless, but it requires the repo to be | ||
| # enrolled in Codecov's GitHub App with OIDC enabled in the | ||
| # Codecov dashboard. Until that is set up, the action falls | ||
| # back to anonymous upload which Codecov silently rate-limits | ||
| # and may drop. `fail_ci_if_error: false` keeps the job green | ||
| # in that case (we don't want a one-off Codecov outage to red- | ||
| # light unrelated PRs) — but it does mean coverage data may not | ||
| # actually land. Watch for the Codecov check on the first few | ||
| # PRs to confirm uploads are flowing. | ||
| - name: Upload to Codecov | ||
| uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 | ||
| with: | ||
| files: lcov.info | ||
| fail_ci_if_error: false | ||
| use_oidc: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # 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. | ||
|
|
||
| # Verbatim port of the dco-check workflow used across the other | ||
| # databricks/databricks-sql-* repos. Enforces `git commit -s` sign-off | ||
| # on every commit in a PR — CLAUDE.md mandates this convention. | ||
|
|
||
| name: DCO Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| dco-check: | ||
| runs-on: | ||
| group: databricks-protected-runner-group | ||
| labels: linux-ubuntu-latest | ||
| name: Check DCO Sign-off | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check DCO Sign-off | ||
| env: | ||
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Checking commits from $BASE_SHA to $HEAD_SHA" | ||
|
|
||
| COMMITS=$(git rev-list --no-merges "$BASE_SHA..$HEAD_SHA") | ||
|
|
||
| if [ -z "$COMMITS" ]; then | ||
| echo "No commits found in this PR" | ||
| exit 0 | ||
| fi | ||
|
|
||
| FAILED_COMMITS=() | ||
|
|
||
| for commit in $COMMITS; do | ||
| echo "Checking commit: $commit" | ||
| COMMIT_MSG=$(git log --format=%B -n 1 "$commit") | ||
| if echo "$COMMIT_MSG" | grep -q "^Signed-off-by: "; then | ||
| echo " Commit $commit has DCO sign-off" | ||
| else | ||
| echo " Commit $commit is missing DCO sign-off" | ||
| FAILED_COMMITS+=("$commit") | ||
| fi | ||
| done | ||
|
|
||
| if [ ${#FAILED_COMMITS[@]} -ne 0 ]; then | ||
| echo "" | ||
| echo "DCO Check Failed!" | ||
| echo "The following commits are missing the required 'Signed-off-by' line:" | ||
| for commit in "${FAILED_COMMITS[@]}"; do | ||
| echo " - $commit: $(git log --format=%s -n 1 "$commit")" | ||
| done | ||
| echo "" | ||
| echo "To fix this, you need to sign off your commits. You can:" | ||
| echo "1. Add sign-off to new commits: git commit -s -m 'Your commit message'" | ||
| echo "2. Amend existing commits: git commit --amend --signoff" | ||
| echo "3. For multiple commits, use: git rebase --signoff HEAD~N (where N is the number of commits)" | ||
| echo "" | ||
| echo "The sign-off should be in the format:" | ||
| echo "Signed-off-by: Your Name <your.email@example.com>" | ||
| echo "" | ||
| echo "For more details, see CONTRIBUTING.md" | ||
| exit 1 | ||
| else | ||
| echo "" | ||
| echo "All commits have proper DCO sign-off!" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # 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. | ||
|
|
||
| # Enforces the dependency-licence allowlist in `deny.toml`. New | ||
| # transitive dependencies with licenses outside `[licenses].allow` | ||
| # fail the build; the contributor either adds the licence (with | ||
| # justification in the PR description) or swaps the dep. | ||
| # | ||
| # Uses `cargo-deny` (the standard Rust ecosystem tool for this) — | ||
| # `cargo-about` is for generating attribution pages, not for gating | ||
| # on an allowlist. `about.toml` is preserved for when an attribution | ||
| # page is needed; CI gates on `deny.toml`. | ||
|
|
||
| name: License Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "Cargo.toml" | ||
| - "Cargo.lock" | ||
| - "deny.toml" | ||
| - ".github/workflows/license-check.yml" | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - "Cargo.toml" | ||
| - "Cargo.lock" | ||
| - "deny.toml" | ||
| - ".github/workflows/license-check.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| cargo-deny: | ||
| name: cargo-deny | ||
| runs-on: | ||
| group: databricks-protected-runner-group | ||
| labels: linux-ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 | ||
|
|
||
| - name: Install cargo-deny | ||
| uses: taiki-e/install-action@a416ddeedbd372e614cc1386e8b642692f66865e # v2.57.1 | ||
| with: | ||
| tool: cargo-deny | ||
|
|
||
| - name: Check licenses, advisories, bans, sources | ||
| # `licenses` is the load-bearing check; `advisories` flags | ||
| # RustSec security advisories; `bans` and `sources` are | ||
| # empty-permissive in our deny.toml today but the slots are | ||
| # there for future hardening. | ||
| run: cargo deny check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # 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] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | ||
| 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 | ||
| with: | ||
| toolchain: stable | ||
| components: rustfmt | ||
|
|
||
| - name: cargo fmt --check | ||
| run: cargo +stable fmt --all -- --check | ||
|
|
||
| clippy: | ||
| name: Clippy | ||
| runs-on: | ||
| group: databricks-protected-runner-group | ||
| labels: linux-ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 | ||
| with: | ||
| toolchain: stable | ||
| components: clippy | ||
|
|
||
| - 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 | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, can have this for better hygiene. This is also enforced in jdbc repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Audit: 1/4 peer repos has a stale workflow (databricks-jdbc/
closeStale.yml); go/nodejs/python don't. Kept per maintainer call — daily cron is zero PR-throughput cost, useful for an early-stage repo. 30-day stale + 7-day close window mirrors databricks-jdbc; happy to soften to 90/14 if the team finds it too aggressive.