1- # VisualCI's CI: lint, test (Rust with Postgres and MinIO, the Ruby client, the frontend build), then on main build and
2- # push the server and renderer images and deploy them by committing their digests to talira-ai/infra
3- # (k3s/resources/visualci/kustomization.yaml), which ArgoCD applies. That commit is the deploy; reverting it is the
4- # rollback.
1+ # VisualCI's CI: lint, test (the root workspace's crates; app/ with Postgres and RustFS; the Ruby client; the frontend
2+ # build), then on main build and push the app and renderer images and deploy them by committing their digests to
3+ # talira-ai/infra (k3s/resources/visualci/kustomization.yaml), which ArgoCD applies. That commit is the deploy;
4+ # reverting it is the rollback.
55name : CI
66
77on :
4848 # snapshot-diff goes on crates.io: it builds without its schemars feature too.
4949 - run : cargo clippy --locked -p snapshot-diff --no-default-features --all-targets -- -D warnings
5050
51- # The Laravel Rust app (app/, sc-8900): its own workspace until it replaces server/ at cutover. Not deployed yet.
51+ # The app (app/, Laravel Rust): its own workspace. Its tests also render every customer email as HTML and text for
52+ # the visual job.
5253 app :
5354 runs-on : ${{ fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
5455 environment : ${{ github.ref == 'refs/heads/main' && 'kache-write' || '' }}
9798 - run : cargo fmt --check
9899 - run : cargo clippy --locked --all-targets -- -D warnings
99100 - run : cargo test --locked
101+ env :
102+ VISUALCI_EMAIL_SNAPSHOTS : ${{ github.workspace }}/tmp/email-snapshots
103+ - uses : actions/upload-artifact@v4
104+ with :
105+ name : email-snapshots
106+ path : tmp/email-snapshots
107+ if-no-files-found : error
108+ retention-days : 7
100109
101110 # The CLI changed since its last release without a version bump: the docs would describe a CLI nobody can download.
102- # Not needed by deploy, so it never holds back the server .
111+ # Not needed by deploy, so it never holds back a release .
103112 cli-version :
104113 runs-on : ubuntu-latest
105114 timeout-minutes : 5
@@ -119,19 +128,11 @@ jobs:
119128 - run : python3 -c 'import yaml' 2>/dev/null || pip install pyyaml
120129 - run : python3 scripts/ci/check_orb.py
121130
131+ # The root workspace's crates (crates/*: the CLI, core, renderer, snapshot-diff, wasm).
122132 test :
123133 runs-on : ${{ fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
124134 environment : ${{ github.ref == 'refs/heads/main' && 'kache-write' || '' }}
125135 timeout-minutes : 40
126- services :
127- postgres :
128- image : postgres:17
129- env :
130- POSTGRES_USER : loco
131- POSTGRES_PASSWORD : loco
132- POSTGRES_DB : visualci_server_test
133- ports : ["55433:5432"]
134- options : --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
135136 steps :
136137 - uses : actions/checkout@v4
137138 # Compile cache (kache, as Cargo's rustc wrapper): the R2 bucket every machine shares (KACHE_BUCKET), else the
@@ -149,25 +150,14 @@ jobs:
149150 s3-prefix : visualci
150151 s3-access-key-id : ${{ github.ref == 'refs/heads/main' && secrets.KACHE_RW_ACCESS_KEY_ID || secrets.KACHE_RO_ACCESS_KEY_ID }}
151152 s3-secret-access-key : ${{ github.ref == 'refs/heads/main' && secrets.KACHE_RW_SECRET_ACCESS_KEY || secrets.KACHE_RO_SECRET_ACCESS_KEY }}
152- # The request tests also write the MCP tools' and REST API's answers as JSON snapshots, for the visual job.
153153 - run : cargo test --locked --workspace
154- env :
155- VISUALCI_JSON_SNAPSHOTS : ${{ github.workspace }}/tmp/json-snapshots/json
156- # Every customer email (server/src/notify.rs), rendered with sample data, as HTML and text.
157- VISUALCI_EMAIL_SNAPSHOTS : ${{ github.workspace }}/tmp/json-snapshots/emails
158- - uses : actions/upload-artifact@v4
159- with :
160- name : json-snapshots
161- path : tmp/json-snapshots
162- if-no-files-found : error
163- retention-days : 7
164154
165155 # VisualCI tests itself: screenshots of the landing page, docs and app (against seeded data), Vitest component
166- # snapshots and the JSON snapshots from `test `, sent as one build to the docspring/visualci project. A changed
156+ # snapshots, app/'s JSON golden files and the emails from `app `, sent as one build to the docspring/visualci project. A changed
167157 # snapshot doesn't fail this job: the GitHub check waits for review. Pull requests from forks have no token and skip
168158 # the upload.
169159 visual :
170- needs : [test ]
160+ needs : [app ]
171161 runs-on : ${{ fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
172162 environment : ${{ github.ref == 'refs/heads/main' && 'kache-write' || '' }}
173163 timeout-minutes : 30
@@ -226,8 +216,8 @@ jobs:
226216 - run : scripts/ci/visual.sh capture
227217 - uses : actions/download-artifact@v4
228218 with :
229- name : json -snapshots
230- path : tmp/json -snapshots
219+ name : email -snapshots
220+ path : tmp/email -snapshots
231221 # VisualCI's own GitHub Action (clients/github-action), with the CLI this commit built.
232222 - uses : ./clients/github-action
233223 with :
@@ -238,8 +228,9 @@ jobs:
238228 tmp/visual/site --prefix site/
239229 tmp/visual/site/docs/quick-start.md --prefix site/docs/ --format text
240230 server/frontend/src --from vitest --prefix components/
241- tmp/json-snapshots/json --prefix json/ --format json
242- tmp/json-snapshots/emails --prefix emails/ --keep-extension
231+ app/tests/golden/api --prefix json/api/ --format json
232+ app/tests/golden/mcp --prefix json/mcp/ --format json
233+ tmp/email-snapshots --prefix emails/ --keep-extension
243234 - if : failure()
244235 uses : actions/upload-artifact@v4
245236 with :
@@ -377,7 +368,7 @@ jobs:
377368 retention-days : 7
378369
379370 # visualci.com is a Cloudflare Worker with static assets (server/frontend/site/wrangler.jsonc), deployed on main
380- # before the server , so the apex never points at a server that no longer serves it. Needs the repo secret
371+ # before the app , so the apex never points at an app that no longer serves it. Needs the repo secret
381372 # CLOUDFLARE_API_TOKEN (Workers Scripts on the DocSpring Products account, Workers Routes on visualci.com) and the
382373 # repo variable CLOUDFLARE_ACCOUNT_ID; without them it warns and skips.
383374 site :
@@ -408,15 +399,14 @@ jobs:
408399 npx --yes wrangler@4.168.0 deploy
409400
410401 images :
411- needs : [lint, test, clients]
402+ needs : [lint, test, app, clients]
412403 if : github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
413404 runs-on : ${{ fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
414405 timeout-minutes : 60
415406 permissions :
416407 contents : read
417408 packages : write
418409 outputs :
419- server : ${{ steps.server.outputs.digest }}
420410 app : ${{ steps.app.outputs.digest }}
421411 renderer : ${{ steps.renderer.outputs.digest }}
422412 steps :
@@ -429,21 +419,7 @@ jobs:
429419 registry : ghcr.io
430420 username : ${{ github.actor }}
431421 password : ${{ secrets.GITHUB_TOKEN }}
432- - id : server
433- uses : docker/build-push-action@v6
434- with :
435- context : .
436- file : docker/server.Dockerfile
437- push : true
438- build-args : |
439- BUILD_SHA=${{ github.sha }}
440- RENDERER_VERSION=${{ steps.version.outputs.renderer }}
441- VISUALCI_ANALYTICS=1
442- tags : ghcr.io/docspring/visualci-server:${{ github.sha }}
443- cache-from : type=gha,scope=server
444- cache-to : type=gha,mode=max,scope=server
445- # VisualCI on Laravel Rust (app/, sc-8900): built on main so the cutover has an image ready, deployed only at
446- # cutover (talira-ai/infra k3s/resources/visualci/laravel)
422+ # The app (app/), which serves the API, the web app, MCP and the site's pages on its hosts
447423 - id : app
448424 uses : docker/build-push-action@v6
449425 with :
@@ -458,7 +434,7 @@ jobs:
458434 cache-from : type=gha,scope=app
459435 cache-to : type=gha,mode=max,scope=app
460436 # The renderer is rebuilt only when its inputs change, so its digest (and the running renderers) stay put
461- # through deploys that only touch the server . Rebuilding an unchanged renderer would give a new digest and roll
437+ # through deploys that only touch the app . Rebuilding an unchanged renderer would give a new digest and roll
462438 # the renderers mid-build for nothing.
463439 - id : renderer_inputs
464440 run : |
0 commit comments