Skip to content

improve ci/cd

improve ci/cd #138

Workflow file for this run

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 }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
DEVELOPER: ${{ github.actor }}
steps:
- uses: actions/checkout@v1
- name: Dump GitHub context
run: echo '${{ toJson(github) }}'
- 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:
uv run python ./scripts/generate_template_workflow.py staging --serverless \
--branch "$BRANCH_NAME" \
--developer "$DEVELOPER"
uv run databricks bundle deploy --target staging
- name: Run on staging (integration tests)
run: |
make run env=staging
- name: Deploy on prod
run:
uv run python ./scripts/generate_template_workflow.py prod --serverless \
--branch "$BRANCH_NAME" \
--developer "$DEVELOPER"
uv run databricks bundle deploy --target prod