|
| 1 | +<!-- |
| 2 | +Copyright 2026 Columnar Technologies Inc. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +--> |
| 16 | + |
| 17 | +# Continuous Integration |
| 18 | + |
| 19 | +dbc works well in non-interactive environments such as on continuous integration (CI) platforms. You may also want to read through our [Version Control](./version_control.md) guide as these two concepts are related. |
| 20 | + |
| 21 | +## GitHub Actions |
| 22 | + |
| 23 | +We recommend using the [columnar-tech/setup-dbc](https://github.com/columnar-tech/setup-dbc) action if you're using [GitHub Actions](https://docs.github.com/en/actions) for CI. |
| 24 | + |
| 25 | +As an example, here's a workflow that automatically installs all drivers listed in your [driver list](../concepts/driver_list.md) before running your tests: |
| 26 | + |
| 27 | +```yaml |
| 28 | +name: Test |
| 29 | +on: [push] |
| 30 | + |
| 31 | +jobs: |
| 32 | + test: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v6 |
| 36 | + |
| 37 | + # Note: Automatically installs drivers specified in dbc.toml |
| 38 | + - uses: columnar-tech/setup-dbc@v1 |
| 39 | + |
| 40 | + - name: Run tests |
| 41 | + run: pytest ... |
| 42 | +``` |
| 43 | +
|
| 44 | +See the [columnar-tech/setup-dbc README](https://github.com/columnar-tech/setup-dbc) for usage information and more examples. |
| 45 | +
|
| 46 | +## Other CI Systems |
| 47 | +
|
| 48 | +To use dbc with other CI systems, we recommend using our command line installers because they will always install the latest version of dbc for whatever platform you run them on. |
| 49 | +
|
| 50 | +As an example for you to adapt to your system, here's a GitHub Actions workflow that installs and makes dbc available without using [columnar-tech/setup-dbc](https://github.com/columnar-tech/setup-dbc): |
| 51 | +
|
| 52 | +{% raw %} |
| 53 | +```yaml |
| 54 | +name: Test |
| 55 | +on: [push] |
| 56 | + |
| 57 | +jobs: |
| 58 | + test: |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + |
| 61 | + strategy: |
| 62 | + matrix: |
| 63 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 64 | + |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v6 |
| 67 | + |
| 68 | + - name: Install dbc (Linux, macOS) |
| 69 | + if: runner.os != 'Windows' |
| 70 | + run: | |
| 71 | + curl -LsSf https://dbc.columnar.tech/install.sh | sh |
| 72 | +
|
| 73 | + - name: Install dbc (Windows) |
| 74 | + if: runner.os == 'Windows' |
| 75 | + run: | |
| 76 | + powershell -ExecutionPolicy ByPass -c "irm https://dbc.columnar.tech/install.ps1 | iex" |
| 77 | +
|
| 78 | + - name: Add dbc to PATH (Linux, macOS) |
| 79 | + if: runner.os != 'Windows' |
| 80 | + shell: bash |
| 81 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 82 | + |
| 83 | + - name: Add dbc to PATH (Windows) |
| 84 | + if: runner.os == 'Windows' |
| 85 | + shell: pwsh |
| 86 | + run: | |
| 87 | + Join-Path $env:USERPROFILE ".local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 88 | +
|
| 89 | + - name: Run tests |
| 90 | + run: pytest ... |
| 91 | +``` |
| 92 | +{% endraw %} |
0 commit comments