Dcv 3288 dbt coves setup improvements #48
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: Test template | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Test Template Integrity | |
| runs-on: ubuntu-latest | |
| container: datacoves/ci-airflow-dbt-snowflake:3 | |
| env: | |
| DBT_PROFILES_DIR: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/generated/automate/dbt | |
| DATACOVES__DBT_HOME: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/generated | |
| DATACOVES__REPO_PATH: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/generated | |
| DATACOVES__MAIN__ACCOUNT: ${{ vars.DATACOVES__MAIN__ACCOUNT }} | |
| DATACOVES__MAIN__DATABASE: ${{ vars.DATACOVES__MAIN__DATABASE }} | |
| DATACOVES__MAIN__SCHEMA: ${{ vars.DATACOVES__MAIN__SCHEMA }} | |
| DATACOVES__MAIN__ROLE: ${{ vars.DATACOVES__MAIN__ROLE }} | |
| DATACOVES__MAIN__WAREHOUSE: ${{ vars.DATACOVES__MAIN__WAREHOUSE }} | |
| DATACOVES__MAIN__USER: ${{ vars.DATACOVES__MAIN__USER }} | |
| DATACOVES__MAIN__PASSWORD: ${{ secrets.DATACOVES__MAIN__PASSWORD }} | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.push.head.sha }} | |
| fetch-depth: 0 | |
| - name: Set Secure Directory | |
| run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }} | |
| - name: Install dependencies | |
| run: pip install -r ci_requirements.txt | |
| - name: Run Copier | |
| run: copier copy --data-file data.yml ./ generated/ | |
| # run dbt debug and dbt compile | |
| - name: Run dbt commands | |
| run: | | |
| cd ./generated | |
| dbt debug | |
| dbt compile | |
| # run `dbt-coves generate airflow dags` | |
| - name: Generate dags | |
| run: | | |
| dbt-coves generate airflow-dags --yml-path generated/orchestrate/dag_yml_definitions/sample_dag.yml --dags-path generated/orchestrate/dags | |
| #fill Airflow DagBag with the result of generated dags | |
| - name: Load dags | |
| run: python test_load_dagbag.py | |
| # run pre-commit | |
| - name: Run pre-commit | |
| run: | | |
| cd ./generated | |
| pre-commit run --all-files |