-
Notifications
You must be signed in to change notification settings - Fork 4
282 lines (243 loc) · 8.84 KB
/
ci.yml
File metadata and controls
282 lines (243 loc) · 8.84 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: CI
on:
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOTNET_VERSION: '9.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
# Track 1: Format Check All -> Lint All -> DataProvider Tests
lint-and-dataprovider:
name: Lint + DataProvider Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.fsproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
Lql/lql-lsp-rust/target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('Lql/lql-lsp-rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-lint-
${{ runner.os }}-cargo-
- name: Restore .NET tools
run: dotnet tool restore
- name: Install Node dependencies (LQL Extension)
run: cd Lql/LqlExtension && npm install --no-audit --no-fund
- name: Format check
run: make fmt-check
- name: Lint
run: make lint
- name: Build CLI tools (needed by F# Type Provider MSBuild targets)
run: |
dotnet build Migration/DataProviderMigrate -c Debug
dotnet build DataProvider/DataProvider -c Debug
- name: Test DataProvider (with coverage enforcement)
run: >-
make _test_dotnet DOTNET_TEST_PROJECTS="DataProvider/Nimblesite.DataProvider.Tests
DataProvider/Nimblesite.DataProvider.Example.Tests"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-dataprovider
path: '**/TestResults/*.trx'
# Track 2: Build All -> LQL Tests -> Migration Tests -> Sync Tests
build-and-test:
name: Build + LQL / Migration / Sync Tests
runs-on: ubuntu-latest
# 15min was insufficient since the new ANTLR Postgres parser + vector
# support landed: pgvector image pull, cargo-tarpaulin install, full
# Sync test matrix, and the new Postgres E2E vector tests push the
# job past 15 min consistently. 30 min gives realistic headroom.
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: changeme
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER: 1
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.fsproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Cache Cargo registry + build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
Lql/lql-lsp-rust/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('Lql/lql-lsp-rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
${{ runner.os }}-cargo-
- name: Restore .NET tools (h5, csharpier, ilspycmd)
run: dotnet tool restore
- name: Build .NET
run: dotnet build DataProvider.sln -c Debug
- name: Build Rust
run: cd Lql/lql-lsp-rust && cargo build
- name: Install Playwright browsers (Reporting.Integration.Tests)
run: |
dotnet build Reporting/Nimblesite.Reporting.Integration.Tests -c Debug
PWSCRIPT=$(find Reporting/Nimblesite.Reporting.Integration.Tests/bin -name 'playwright.ps1' | head -1)
if [ -z "$PWSCRIPT" ]; then
echo "playwright.ps1 not found under Reporting.Integration.Tests bin"; exit 1
fi
pwsh "$PWSCRIPT" install --with-deps chromium
- name: Test LQL + Migration + Sync + Reporting (with coverage enforcement)
run: >-
make _test_dotnet DOTNET_TEST_PROJECTS="Lql/Nimblesite.Lql.Tests
Lql/Nimblesite.Lql.TypeProvider.FSharp.Tests
Migration/Nimblesite.DataProvider.Migration.Tests
Sync/Nimblesite.Sync.Tests
Sync/Nimblesite.Sync.SQLite.Tests
Sync/Nimblesite.Sync.Postgres.Tests
Sync/Nimblesite.Sync.Integration.Tests
Sync/Nimblesite.Sync.Http.Tests
Reporting/Nimblesite.Reporting.Tests
Reporting/Nimblesite.Reporting.Integration.Tests"
env:
TESTCONTAINERS_RYUK_DISABLED: false
- name: Test LQL Rust (with coverage enforcement)
run: make _test_rust
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-build
path: '**/TestResults/*.trx'
# Track 3: Build All -> LQL Extension Tests
extension-tests:
name: LQL Extension Tests
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: changeme
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry + build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
Lql/lql-lsp-rust/target
key: ${{ runner.os }}-cargo-extension-${{ hashFiles('Lql/lql-lsp-rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-extension-
${{ runner.os }}-cargo-
- name: Install VSCode runtime dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
xvfb \
libnss3 \
libgbm1 \
libdrm2 \
libxkbcommon-x11-0 \
libgtk-3-0 \
libasound2t64 \
libsecret-1-0 \
libsndio7.0 || \
sudo apt-get install -y --no-install-recommends \
xvfb \
libnss3 \
libgbm1 \
libdrm2 \
libxkbcommon-x11-0 \
libgtk-3-0
- name: Build lql-lsp binary (release)
run: cd Lql/lql-lsp-rust && cargo build --release -p lql-lsp
- name: Verify lql-lsp --version
run: |
./Lql/lql-lsp-rust/target/release/lql-lsp --version
# Confirm the printed version matches the VSIX package.json version
BIN_VERSION=$(./Lql/lql-lsp-rust/target/release/lql-lsp --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
VSIX_VERSION=$(jq -r '.version' Lql/LqlExtension/package.json)
echo "Binary version: $BIN_VERSION"
echo "VSIX version: $VSIX_VERSION"
if [ "$BIN_VERSION" != "$VSIX_VERSION" ]; then
echo "ERROR: lql-lsp --version ($BIN_VERSION) does not match VSIX version ($VSIX_VERSION)"
exit 1
fi
- name: Install dependencies
run: cd Lql/LqlExtension && npm install --no-audit --no-fund
- name: Test Extension (with coverage enforcement)
env:
POSTGRES_CONNECTION_STRING: "Host=localhost;Port=5432;Username=postgres;Password=changeme;Database=postgres"
run: |
export PATH="$PWD/Lql/lql-lsp-rust/target/release:$PATH"
make _test_ts
- name: Package VSIX (dry run)
run: cd Lql/LqlExtension && npm run compile && npx vsce package --no-git-tag-version --no-update-package-json