add dbt compile step #25
This file contains 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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
profile: ajc_adb_dbt_all_purpose | |
jobs: | |
run_dbt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install dbt-databricks sqlfluff-templater-dbt | |
- name: Verify installation | |
run: | | |
dbt --version | |
sqlfluff --version | |
- name: Lint with sqlfluff | |
run: | | |
dbt compile --profile $profile | |
sqlfluff lint models/*.sql | |
- name: dbt debug profile | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt debug --profile $profile | |
- name: dbt deps | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt deps --profile $profile | |
- name: dbt build | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt build --profile $profile | |
- name: Publish artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: models/*.sql |