ci: use reusable workflows from dbt-labs/dbt-package-testing@v2 #31
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
| # **what?** | |
| # Run tests using dbt Fusion against supported adapters | |
| # **why?** | |
| # To ensure that dbt-project-evaluator works as expected with dbt Fusion | |
| # This runs alongside (not replacing) the existing dbt-core tests | |
| # **when?** | |
| # On every PR, and every push to main and when manually triggered | |
| # **note** | |
| # DuckDB runs first as a quick check that does not require cloud credentials. | |
| # Cloud adapter tests use the reusable workflow from dbt-labs/dbt-package-testing. | |
| name: Fusion Integration Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request_target: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| PYTHON_VERSION: "3.11" | |
| jobs: | |
| run-duckdb-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout PR code" | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: "Set up Python ${{ env.PYTHON_VERSION }}" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: "Install dbt Fusion" | |
| run: | | |
| curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: "Verify Fusion installation" | |
| run: | | |
| dbt --version | |
| - name: "Install tox" | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: "Run Fusion integration tests on duckdb" | |
| run: | | |
| tox -e dbt_integration_fusion_duckdb | |
| fusion-tests: | |
| needs: run-duckdb-tests | |
| uses: dbt-labs/dbt-package-testing/.github/workflows/run_tox_fusion.yml@v2 | |
| with: | |
| # Only Snowflake for now - add more adapters here as Fusion support expands | |
| adapters: "snowflake" | |
| environment: >- | |
| ${{ github.event_name == 'pull_request_target' | |
| && github.event.pull_request.head.repo.full_name != github.repository | |
| && 'cloud-tests' || '' }} | |
| ref: ${{ github.event.pull_request.head.sha || '' }} | |
| # snowflake | |
| SNOWFLAKE_USER: ${{ vars.SNOWFLAKE_USER }} | |
| SNOWFLAKE_ROLE: ${{ vars.SNOWFLAKE_ROLE }} | |
| SNOWFLAKE_DATABASE: ${{ vars.SNOWFLAKE_DATABASE }} | |
| SNOWFLAKE_WAREHOUSE: ${{ vars.SNOWFLAKE_WAREHOUSE }} | |
| SNOWFLAKE_SCHEMA: "fusion_integration_tests_snowflake_${{ github.run_number }}" | |
| secrets: | |
| SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | |
| DBT_ENV_SECRET_SNOWFLAKE_PASS: ${{ secrets.SNOWFLAKE_PASS }} |