Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/actions/setup-public-package-proxies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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.

name: Set up public package proxies
description: Configure unauthenticated Databricks-filtered Cargo and Python package proxies.
Comment thread
rahuls-db marked this conversation as resolved.
Resolved

inputs:
cargo:
description: Configure Cargo to use the public Databricks crates proxy.
required: false
default: "false"
uv:
description: Configure uv and pip to use the public Databricks PyPI proxy.
required: false
default: "false"

runs:
using: composite
steps:
- name: Configure Cargo package proxy
if: inputs.cargo == 'true'
shell: bash
run: |
set -euo pipefail
mkdir -p ~/.cargo
cat > ~/.cargo/config.toml <<'EOF'
[source.crates-io]
replace-with = "databricks-proxy"

[source.databricks-proxy]
registry = "sparse+https://crates-proxy.cloud.databricks.com/"
Comment thread
rahuls-db marked this conversation as resolved.
Resolved

[http]
timeout = 120

[net]
git-fetch-with-cli = true
retry = 5
EOF

- name: Configure Python package proxy
if: inputs.uv == 'true'
shell: bash
run: |
set -euo pipefail
echo "UV_INDEX_URL=https://pypi-proxy.cloud.databricks.com/simple/" >> "$GITHUB_ENV"
echo "PIP_INDEX_URL=https://pypi-proxy.cloud.databricks.com/simple/" >> "$GITHUB_ENV"
63 changes: 48 additions & 15 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ on:
- "pyo3/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/actions/setup-public-package-proxies/**"
- ".github/workflows/coverage.yml"
pull_request:
branches: [main]
Expand All @@ -41,6 +42,7 @@ on:
- "pyo3/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/actions/setup-public-package-proxies/**"
- ".github/workflows/coverage.yml"
workflow_dispatch:

Expand All @@ -50,8 +52,6 @@ concurrency:

permissions:
contents: read
id-token: write
pull-requests: write

defaults:
run:
Expand All @@ -71,7 +71,7 @@ jobs:
with:
fetch-depth: 0

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand All @@ -95,18 +95,51 @@ jobs:
cargo llvm-cov --workspace --lcov --output-path lcov.info
cargo llvm-cov --manifest-path adbc/Cargo.toml --features ffi --lcov --output-path adbc-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
- name: Store coverage reports for trusted upload
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-reports
path: |
lcov.info
adbc-lcov.info
if-no-files-found: error
retention-days: 1

# Fork PRs cannot receive OIDC permissions. Keep their advisory coverage
# upload in the unprivileged build job instead.
- name: Upload fork coverage anonymously
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: lcov.info,adbc-lcov.info
fail_ci_if_error: false

upload:
name: Upload coverage to Codecov
needs: coverage
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- name: Checkout repository metadata
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download coverage reports
Comment thread
rahuls-db marked this conversation as resolved.
Resolved
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-reports

# This job only handles generated reports, so contributor-controlled
# build scripts cannot access its OIDC mint permission.
- name: Upload to Codecov with OIDC
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: lcov.info,adbc-lcov.info
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ concurrency:

permissions:
contents: read
# Required for the OIDC token exchange that the
# `.github/actions/setup-jfrog` composite uses. See go/hardened-gha.
id-token: write

defaults:
run:
Expand All @@ -80,7 +77,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/napi-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ on:
# Root Cargo.toml change can affect napi via its `path = ".."`
# kernel dep, so this workflow re-runs to catch mismatches.
- "Cargo.toml"
- ".github/actions/setup-public-package-proxies/**"
- ".github/workflows/napi-checks.yml"
pull_request:
branches: [main]
paths:
- "napi/**"
- "src/**"
- "Cargo.toml"
- ".github/actions/setup-public-package-proxies/**"
- ".github/workflows/napi-checks.yml"

concurrency:
Expand All @@ -51,8 +53,6 @@ concurrency:

permissions:
contents: read
# `id-token: write` is scoped to the single job that exchanges an OIDC
# token for JFrog access.

defaults:
run:
Expand All @@ -61,12 +61,8 @@ defaults:
jobs:
check-and-test:
name: "napi fmt + clippy + test"
# Scoped here (not workflow-wide): `id-token: write` is only needed
# for the OIDC token exchange in `.github/actions/setup-jfrog` that
# authenticates against the JFrog cargo proxy. See go/hardened-gha.
permissions:
contents: read
id-token: write
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand All @@ -80,12 +76,10 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Route cargo through the JFrog crates proxy. The protected
# runner group blocks direct crates.io, so without this every
# cargo command below fails to update the registry index. The
# composite writes ~/.cargo/config.toml (a source replacement),
# which preserves resolved versions, so `--locked` stays valid.
- uses: ./.github/actions/setup-jfrog
# Route cargo through the unauthenticated filtered proxy so fork PRs
# never receive an OIDC mint permission while executing
# contributor-controlled code.
- uses: ./.github/actions/setup-public-package-proxies
Comment thread
rahuls-db marked this conversation as resolved.
Resolved
with:
cargo: "true"

Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ concurrency:

permissions:
contents: read
# Required for the OIDC token exchange that the
# `.github/actions/setup-jfrog` composite uses to authenticate
# against the JFrog cargo proxy. See go/hardened-gha.
id-token: write

defaults:
run:
Expand Down Expand Up @@ -88,7 +84,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand All @@ -114,7 +110,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand Down Expand Up @@ -143,7 +139,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand Down Expand Up @@ -172,7 +168,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand Down Expand Up @@ -211,7 +207,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-jfrog
- uses: ./.github/actions/setup-public-package-proxies
with:
cargo: "true"

Expand Down
Loading
Loading