Skip to content

Commit

Permalink
Merge pull request #68 from DalgoT4D/feature/ci-cd_pipeline
Browse files Browse the repository at this point in the history
add the ci cd pipeline for testing
  • Loading branch information
siddhant3030 authored Jan 10, 2025
2 parents d7fb96c + a011df1 commit cba9da5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/.dbt-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Our first dbt PR job
#updates
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- '!main'

jobs:
dbt_ci:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install requirements
run: pip install -r requirements.txt

- name: Install dbt dependencies
run: dbt deps

- name: dbt build
run: dbt build --full-refresh --profiles-dir ./
env:
POSTGRES_DBNAME: ${{ secrets.POSTGRES_DBNAME }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}

- name: Benchmarking models
run: "sqlfluff lint models --bench"

- name: Lint models
run: "sqlfluff lint models -f human"
11 changes: 11 additions & 0 deletions .sqlfluff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://docs.sqlfluff.com/en/stable/configuration.html#default-configuration

[sqlfluff]
# Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
# Or run 'sqlfluff dialects'
dialect = postgres
templater = dbt

# Comma separated list of rules to exclude, or None
exclude_rules = L001,L029,RF05, LT05, ST06, RF02
#max_line_length = 120
7 changes: 7 additions & 0 deletions .sqlfluffignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# dbt output files
target/
dbt_packages/

# other
analysis/
macros/
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sqlfluff==3.2.5
dbt-postgres==1.7.17
sqlfluff-templater-dbt==3.2.5

0 comments on commit cba9da5

Please sign in to comment.