Skip to content

fix(dbt): corrigir sintaxe do teste accepted_values para dbt 1.7 #2

fix(dbt): corrigir sintaxe do teste accepted_values para dbt 1.7

fix(dbt): corrigir sintaxe do teste accepted_values para dbt 1.7 #2

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: finance_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Setup database schema
run: |
PGPASSWORD=postgres psql -h localhost -U postgres -d finance_db -f database/ddl/01_create_schema.sql
PGPASSWORD=postgres psql -h localhost -U postgres -d finance_db -f database/seeds/01_seed_data.sql
- name: Configure dbt profile
run: |
mkdir -p ~/.dbt
cat > ~/.dbt/profiles.yml << EOF
dbt_project:
target: ci
outputs:
ci:
type: postgres
host: localhost
user: postgres
password: postgres
port: 5432
dbname: finance_db
schema: public
threads: 1
EOF
- name: Run dbt
run: |
cd dbt_project
dbt debug
dbt run
dbt test
- name: Validate Streamlit app
run: |
python -c "
import sys
sys.path.insert(0, 'streamlit_app')
try:
import app
print('✅ Streamlit app imports successfully')
except Exception as e:
print(f'❌ Streamlit import failed: {e}')
sys.exit(1)
"
env:
DB_HOST: localhost
DB_NAME: finance_db
DB_USER: postgres
DB_PASSWORD: postgres