Refactor project structure and update documentation #14
Workflow file for this run
This file contains hidden or 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: PR CI - SQLFluff Linting and dbt Testing | |
| on: | |
| pull_request: | |
| branches: [main, develop] | |
| paths: # Only trigger when relevant files change | |
| - "**.sql" | |
| - "dbt_project/**" | |
| - ".github/workflows/pr_ci.yml" | |
| jobs: | |
| PR_CI: | |
| runs-on: ubuntu-latest | |
| env: | |
| SNOWFLAKE_ACCOUNT: ${{ vars.SNOWFLAKE_ACCOUNT }} | |
| SNOWFLAKE_USER: ${{ vars.SNOWFLAKE_USER }} | |
| SNOWFLAKE_DATABASE: ${{ vars.SNOWFLAKE_DATABASE }} | |
| SNOWFLAKE_WAREHOUSE: ${{ vars.SNOWFLAKE_WAREHOUSE }} | |
| SNOWFLAKE_ROLE: ${{ vars.SNOWFLAKE_ROLE }} | |
| SNOWFLAKE_SCHEMA: ${{ vars.SNOWFLAKE_SCHEMA }} | |
| SNOWFLAKE_PRIVATE_KEY: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Cache uv dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .venv | |
| ~/.cache/uv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Install CI dependencies | |
| run: | | |
| uv sync --frozen | |
| - name: Run dbt debug | |
| run: | | |
| cd dbt_project && uv run dbt debug --target test | |
| - name: Run dbt deps | |
| run: | | |
| cd dbt_project && uv run dbt deps --target test | |
| - name: Run SQLFluff lint | |
| run: | | |
| cd dbt_project && uv run sqlfluff lint models | |
| - name: Run dbt tests | |
| run: | | |
| cd dbt_project && uv run dbt test --target test |