Add requirements.txt for SQL and DBT dependencies (#15) #23
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: build_dbt | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- adb/** | |
- adf/** | |
- readme.md | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- adb/** | |
- adf/** | |
- readme.md | |
env: | |
profile: ajc_adb_dbt_all_purpose | |
jobs: | |
dbt_ci: | |
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: dbt debug | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt debug --profile $profile | |
- name: dbt deps | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt deps --profile $profile | |
- name: dbt compile | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt compile --profile $profile | |
- name: sqlfluff lint | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
sqlfluff lint models/*.sql | |
- name: dbt build | |
env: | |
adbtoken: ${{ secrets.ADBTOKEN }} | |
run: | | |
dbt build --profile $profile | |
- name: artifact publish | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dbt_artifact | |
path: | | |
**/* | |
!adf/** | |
!adb/** |