making some regression errors and linting issues #24
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: Lint Models | |
on: | |
pull_request: | |
push: | |
branches: | |
- '!main' | |
jobs: | |
lint-models: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
- name: Set up Snowflake profile | |
env: | |
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }} | |
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | |
SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }} | |
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }} | |
SNOWFLAKE_ROLE: ${{ secrets.SNOWFLAKE_ROLE }} | |
run: | | |
mkdir -p ~/.dbt/ | |
echo "snowflake:" >> ~/.dbt/profiles.yml | |
echo " target: prod" >> ~/.dbt/profiles.yml | |
echo " outputs:" >> ~/.dbt/profiles.yml | |
echo " prod:" >> ~/.dbt/profiles.yml | |
echo " type: snowflake" >> ~/.dbt/profiles.yml | |
echo " account: $SNOWFLAKE_ACCOUNT" >> ~/.dbt/profiles.yml | |
echo " user: $SNOWFLAKE_USER" >> ~/.dbt/profiles.yml | |
echo " password: $SNOWFLAKE_PASSWORD" >> ~/.dbt/profiles.yml | |
echo " role: $SNOWFLAKE_ROLE" >> ~/.dbt/profiles.yml | |
echo " database: $SNOWFLAKE_DATABASE" >> ~/.dbt/profiles.yml | |
echo " warehouse: $SNOWFLAKE_WAREHOUSE" >> ~/.dbt/profiles.yml | |
echo " schema: pr_$(date +%s)" >> ~/.dbt/profiles.yml | |
- name: Install dbt Dependencies | |
run: dbt deps | |
- name: Generate dbt manifest.json | |
run: dbt ls # or dbt compile | |
- name: Lint models | |
run: "sqlfluff lint models" |