Skip to content

[Feature] Adiciona checagens para o dbt #2

[Feature] Adiciona checagens para o dbt

[Feature] Adiciona checagens para o dbt #2

Workflow file for this run

name: DBT Checks
on:
pull_request:
branches:
- main
- staging/*
paths:
- "queries/**/*.sql"
jobs:
check-files:
name: Compile DBT models and format SQL
runs-on: ubuntu-latest
defaults:
run:
working-directory: queries
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python version
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install requirements
run: |-
pip install --no-cache-dir -r requirements.txt
- name: Install sqlfmt
run: pip install shandy-sqlfmt[jinjafmt]
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v34
# Setup gcloud CLI
- name: Setup Google Cloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT_ID}}
export_default_credentials: true
- name: Setup DBT profile
run: sh setup_dbt_profiles.sh
- name: Run DBT compile
run: |-
dbt compile --profiles-dir profiles
- name: Run sqlfmt
run: sqlfmt --diff ${{ steps.changed-files.outputs.all_changed_files }}