-
Notifications
You must be signed in to change notification settings - Fork 357
148 lines (139 loc) · 5.1 KB
/
pr.yaml
File metadata and controls
148 lines (139 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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@v6
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]
# As at 2026-01-12 this job flakes 100% of the time. It needs investigation
if: false
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
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@v6
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v7
- 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: 30
run: |
source ../../.venv/bin/activate
pnpm run test:e2e
- uses: actions/upload-artifact@v5
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', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10']
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install SQLMesh dev dependencies
run: |
uv venv .venv
source .venv/bin/activate
UV=1 make install-dev-dbt-${{ matrix.dbt-version }}
- 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
# Remove semantic_models and metrics sections for DBT versions < 1.6.0
# Using explicit list to avoid version comparison issues
if [[ "${{ matrix.dbt-version }}" == "1.3" ]] || \
[[ "${{ matrix.dbt-version }}" == "1.4" ]] || \
[[ "${{ matrix.dbt-version }}" == "1.5" ]]; then
echo "DBT version is ${{ matrix.dbt-version }} (< 1.6.0), removing semantic_models and metrics sections..."
schema_file="tests/fixtures/dbt/sushi_test/models/schema.yml"
if [[ -f "$schema_file" ]]; then
echo "Modifying $schema_file..."
# Create a temporary file
temp_file=$(mktemp)
# Use awk to remove semantic_models and metrics sections
awk '
/^semantic_models:/ { in_semantic=1; next }
/^metrics:/ { in_metrics=1; next }
/^[^ ]/ && (in_semantic || in_metrics) {
in_semantic=0;
in_metrics=0
}
!in_semantic && !in_metrics { print }
' "$schema_file" > "$temp_file"
# Move the temp file back
mv "$temp_file" "$schema_file"
echo "Successfully removed semantic_models and metrics sections"
else
echo "Schema file not found at $schema_file, skipping..."
fi
else
echo "DBT version is ${{ matrix.dbt-version }} (>= 1.6.0), keeping semantic_models and metrics sections"
fi
make dbt-fast-test
- 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