GitHub Action to set up dbc and install drivers in CI.
- π Fast installation using official dbc install scripts
- πΎ Automatic caching for faster subsequent runs
- π Optional API key authentication for private drivers
- π¦ Driver installation via explicit list or config file
- π₯οΈ Cross-platform support (Linux, macOS, Windows)
- π Version pinning for reproducible builds
Install the latest version of dbc CLI:
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1
- run: dbc --versionPin to a specific version for reproducibility:
steps:
- uses: columnar-tech/setup-dbc@v1
with:
version: 'v0.2.0'Install drivers using a comma-separated list:
steps:
- uses: columnar-tech/setup-dbc@v1
with:
drivers: 'postgresql,mysql,sqlite'Authenticate with API key for private drivers:
steps:
- uses: columnar-tech/setup-dbc@v1
with:
api-key: ${{ secrets.DBC_API_KEY }}
drivers: 'oracle,teradata,postgresql'If dbc.toml is present at the workspace root, the action will run dbc sync automatically:
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1The above is equivalent to:
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1
with:
driver-list-file: 'dbc.toml'See Using a Driver List to learn more about driver list files.
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1
with:
driver-list-file: 'config/custom-dbc.toml'Install only the CLI without drivers:
steps:
- uses: columnar-tech/setup-dbc@v1
with:
skip-drivers: 'true'| Input | Description | Required | Default |
|---|---|---|---|
version |
Version of dbc CLI to install (e.g., v0.2.0 or latest) |
No | latest |
api-key |
API key for authenticating private driver installations | No | - |
drivers |
Comma-separated list of drivers to install | No | - |
driver-list-file |
Path to dbc.toml config file for driver installation | No | dbc.toml |
skip-drivers |
Skip driver installation even if drivers specified | No | false |
| Output | Description |
|---|---|
version |
The installed version of dbc CLI |
cache-hit |
Whether the dbc CLI was restored from cache |
If both drivers and driver-list-file inputs are provided, the explicit drivers list takes precedence.
This action automatically caches the dbc CLI binary based on the version and OS. Subsequent runs with the same version will be significantly faster.
- Exit code 1: CLI installation failed
- Exit code 2: Driver installation failed (CLI installed successfully)
This allows you to differentiate between CLI and driver failures in your workflows.
name: Test Database
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1
with:
version: 'v0.2.0'
drivers: 'postgresql,mysql'
- name: Run tests
run: pytest ...Test against multiple driver versions:
name: Matrix Test
on: [push]
jobs:
test:
strategy:
matrix:
driver: [postgresql, mysql, sqlite]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: columnar-tech/setup-dbc@v1
with:
drivers: ${{ matrix.driver }}
- run: pytest ...Apache-2.0