Upgrade to DBR 18 LTS, enforce CLI version, and improve CI/CD traceab… #136
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
| name: CI pipeline | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - 'v*' # this tag type is used for release pipelines | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| jobs: | |
| ci-pipeline: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 1 | |
| env: | |
| DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} | |
| DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.8" | |
| - name: Install dependencies | |
| run: | | |
| make sync | |
| - name: Run pytest and coverage (unit tests) | |
| run: | | |
| make test | |
| - name: Install Databricks CLI | |
| uses: databricks/setup-cli@main | |
| - name: Deploy on staging | |
| run: | | |
| BRANCH_NAME="${{ github.head_ref || github.ref_name }}" | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| DEVELOPER="${{ github.actor }}" | |
| uv run python ./scripts/generate_template_workflow.py staging --serverless \ | |
| --branch "$BRANCH_NAME" \ | |
| --developer "$DEVELOPER" \ | |
| $(if [ -n "$PR_NUMBER" ]; then echo "--pr-number $PR_NUMBER"; fi) | |
| uv run databricks bundle deploy --target staging | |
| - name: Run on staging (integration tests) | |
| run: | | |
| make run env=staging | |
| - name: Deploy on prod | |
| run: | | |
| BRANCH_NAME="${{ github.head_ref || github.ref_name }}" | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| DEVELOPER="${{ github.actor }}" | |
| uv run python ./scripts/generate_template_workflow.py prod --serverless \ | |
| --branch "$BRANCH_NAME" \ | |
| --developer "$DEVELOPER" \ | |
| $(if [ -n "$PR_NUMBER" ]; then echo "--pr-number $PR_NUMBER"; fi) | |
| uv run databricks bundle deploy --target prod |