feat: widen dbt-core compatibility range #2061
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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: 'pr-${{ github.event.pull_request.number }}' | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-vscode: | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run CI | |
| run: pnpm run ci | |
| test-vscode-e2e: | |
| runs-on: | |
| labels: [ubuntu-2204-8] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install python dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| make install-dev | |
| - name: Install code-server | |
| run: curl -fsSL https://code-server.dev/install.sh | sh | |
| - name: Install Playwright browsers | |
| working-directory: ./vscode/extension | |
| run: pnpm exec playwright install | |
| - name: Run e2e tests | |
| working-directory: ./vscode/extension | |
| timeout-minutes: 90 | |
| run: | | |
| source ../../.venv/bin/activate | |
| pnpm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: vscode/extension/playwright-report/ | |
| retention-days: 30 | |
| test-dbt-versions: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dbt-version: ["1.3.0", "1.4.0", "1.5.0", "1.6.0", "1.7.0", "1.8.0", "1.9.0", "1.10.0"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install SQLMesh dev dependencies | |
| run: | | |
| uv venv .venv | |
| source .venv/bin/activate | |
| sed -i 's/"pydantic>=2.0.0"/"pydantic"/g' pyproject.toml | |
| if [[ "${{ matrix.dbt-version }}" == "1.10.0" ]]; then | |
| # For 1.10.0: only add version to dbt-core, remove versions from all adapter packages | |
| sed -i -E 's/"(dbt-core)[^"]*"/"\1~=${{ matrix.dbt-version }}"/g' pyproject.toml | |
| # Remove version constraints from all dbt adapter packages | |
| sed -i -E 's/"(dbt-(bigquery|duckdb|snowflake|athena-community|clickhouse|databricks|redshift|trino))[^"]*"/"\1"/g' pyproject.toml | |
| else | |
| # For other versions: apply version to all dbt packages | |
| sed -i -E 's/"(dbt-[^">=<~!]+)[^"]*"/"\1~=${{ matrix.dbt-version }}"/g' pyproject.toml | |
| fi | |
| UV=1 make install-dev | |
| uv pip install pydantic>=2.0.0 --reinstall | |
| - name: Run dbt tests | |
| # We can't run slow tests across all engines due to tests requiring DuckDB and old versions | |
| # of DuckDB require a version of DuckDB we no longer support | |
| run: | | |
| source .venv/bin/activate | |
| make dbt-fast-test | |
| # - name: Remove versions sections for dbt < 1.5.0 | |
| # run: | | |
| # if [[ "${{ matrix.dbt-version }}" < "1.5.0" ]]; then | |
| # echo "DBT version is ${{ matrix.dbt-version }}, removing versions sections..." | |
| # sed -i '/^ versions:/,/^[^ ]/{ /^ versions:/d; /^ - v:/d; }' examples/sushi_dbt/models/schema.yml | |
| # else | |
| # echo "DBT version is ${{ matrix.dbt-version }}, keeping versions sections" | |
| # fi | |
| - name: Test SQLMesh info in sushi_dbt | |
| working-directory: ./examples/sushi_dbt | |
| run: | | |
| source ../../.venv/bin/activate | |
| sed -i 's/target: in_memory/target: postgres/g' profiles.yml | |
| if [[ $(echo -e "${{ matrix.dbt-version }}\n1.5.0" | sort -V | head -n1) == "${{ matrix.dbt-version }}" ]] && [[ "${{ matrix.dbt-version }}" != "1.5.0" ]]; then | |
| echo "DBT version is ${{ matrix.dbt-version }} (< 1.5.0), removing version parameters..." | |
| sed -i -e 's/, version=1) }}/) }}/g' -e 's/, v=1) }}/) }}/g' models/top_waiters.sql | |
| else | |
| echo "DBT version is ${{ matrix.dbt-version }} (>= 1.5.0), keeping version parameters" | |
| fi | |
| sqlmesh info --skip-connection |