-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (120 loc) · 5.36 KB
/
Copy pathci.yml
File metadata and controls
122 lines (120 loc) · 5.36 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
name: CI
# The npm packages' gate. A change confined to the VS Code extension or the
# JetBrains plugin has its own workflow, so skip this one for those - but any
# shared file (lockfile, root config, this workflow) still runs it, since
# paths-ignore only skips when EVERY changed file is under an ignored path.
on:
# A run that wedges (a platform incident, a lost runner) cannot otherwise be retriggered
# without inventing a file change, since every trigger below is path filtered.
workflow_dispatch:
push:
branches: [main, develop]
paths-ignore:
- 'packages/vscode/**'
- 'packages/jetbrains/**'
- 'packages/browser-extension/**'
pull_request:
paths-ignore:
- 'packages/vscode/**'
- 'packages/jetbrains/**'
- 'packages/browser-extension/**'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Passthrough covers every path ci.yml ignores
run: |
# Each file carries one kind of path list, so its quoted packages/... list
# items ARE the list. Anchored to list items so this step's own pattern,
# which is not one, does not match itself.
entries() { sed -n "s/^[[:space:]]*- '\(packages\/[^']*\)'[[:space:]]*$/\1/p" "$1" | sort -u; }
ignored="$(entries .github/workflows/ci.yml)"
covered="$(entries .github/workflows/ci-passthrough.yml)"
if [ "$ignored" != "$covered" ]; then
# Quoted: these entries end in ** and would otherwise glob against the checkout.
echo 'ci.yml paths-ignore:'; echo "$ignored"
echo 'ci-passthrough.yml paths:'; echo "$covered"
echo "::error::ci.yml's paths-ignore and ci-passthrough.yml's paths must be identical. A path ignored here and missing there reports no 'check' at all, so a PR touching only that path waits forever on the required status."
exit 1
fi
echo "Passthrough covers every ignored path."
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build # tsc -b: typecheck + emit in one pass
# Live DB / AI / browser suites self-skip without services, keys, or Chrome.
- run: pnpm format:check
# A hand-versioned surface must describe its own version; changesets covers the rest.
- run: pnpm changelog:check
# `coverage`, not `test`: the floor in vitest.config.ts applies only with --coverage.
- run: pnpm coverage
# Packs the tarballs and installs them outside the workspace, where a dependency that is
# used but never declared has no workspace link to resolve through.
- run: node tools/packaged-consumer-test.mjs --skip-build
# The side panel loads its code in chunks, so the only check that proves the extension still
# starts is loading it in a real browser. Regular Chrome refuses --load-extension.
- run: pnpm --filter asksql-browser-extension run build
- name: Browser extension smoke test
run: |
chrome_path="$(npx --yes @puppeteer/browsers@latest install chrome@151.0.7922.76 | awk '{ $1=""; sub(/^ /,""); print }')"
node test/e2e-smoke.mjs "$chrome_path"
working-directory: packages/browser-extension
# Real engines, hostile schemas, no model. A mixed-case Postgres schema once failed every query
# and shipped that way, because every database test used tables we had written ourselves.
room-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter='./packages/*' build
# An Android app's database: Long ids, INTEGER booleans, epoch millis, Room bookkeeping, FTS
# shadow tables and a WAL sidecar. Every fixture the suite owned used real types, so none of it
# was covered. No model involved, so the result is deterministic.
- run: pnpm test:room
schema-regression:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: pg
POSTGRES_DB: schema_regression
ports:
- 5433:5432
options: >-
--health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 12
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: schema_regression
ports:
- 3307:3306
options: >-
--health-cmd "mysqladmin ping -h127.0.0.1" --health-interval 5s --health-timeout 5s --health-retries 20
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
# The harness exits non-zero if an engine is unreachable, so a silent skip cannot pass here.
- run: pnpm test:schemas -- --require=postgres,mysql,sqlite
env:
ASKSQL_PG_URL: postgres://postgres:pg@127.0.0.1:5433/schema_regression
ASKSQL_MYSQL_HOST: 127.0.0.1
ASKSQL_MYSQL_PORT: '3307'
ASKSQL_MYSQL_USER: root
ASKSQL_MYSQL_PASSWORD: ''