Setup dbc Action

April 13, 2026 ยท View on GitHub

GitHub Action to set up dbc and install drivers in CI.

Features

  • ๐Ÿš€ 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

Usage

Basic Setup

Install the latest version of dbc CLI:

steps:
  - uses: actions/checkout@v6
  - uses: columnar-tech/setup-dbc@v1
  - run: dbc --version

With Specific Version

Pin to a specific version for reproducibility:

steps:
  - uses: columnar-tech/setup-dbc@v1
    with:
      version: 'v0.2.0'

With Driver Installation

Install drivers using a comma-separated list:

steps:
  - uses: columnar-tech/setup-dbc@v1
    with:
      drivers: 'postgresql,mysql,sqlite'

With Private Drivers

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'

Installing Drivers From A Driver List

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@v1

The 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.

Custom Driver List Path

steps:
  - uses: actions/checkout@v6
  - uses: columnar-tech/setup-dbc@v1
    with:
      driver-list-file: 'config/custom-dbc.toml'

Skip Driver Installation

Install only the CLI without drivers:

steps:
  - uses: columnar-tech/setup-dbc@v1
    with:
      skip-drivers: 'true'

Inputs

InputDescriptionRequiredDefault
versionVersion of dbc CLI to install (e.g., v0.2.0 or latest)Nolatest
api-keyAPI key for authenticating private driver installationsNo-
driversComma-separated list of drivers to installNo-
driver-list-filePath to dbc.toml config file for driver installationNodbc.toml
skip-driversSkip driver installation even if drivers specifiedNofalse

Outputs

OutputDescription
versionThe installed version of dbc CLI
cache-hitWhether the dbc CLI was restored from cache

Driver Installation Priority

If both drivers and driver-list-file inputs are provided, the explicit drivers list takes precedence.

Caching

This action automatically caches the dbc CLI binary based on the version and OS. Subsequent runs with the same version will be significantly faster.

Error Handling

  • 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.

Examples

Complete Workflow

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 ...

Matrix Testing

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 ...

License

Apache-2.0