mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
- crates/: standalone server-side Rust workspace (resolver 3, edition
2024, own lock and toolchain 1.98.1)
- frame-audit: the one serde-only FrameSnapshot schema and audit
engine; native-playground's ui depends on it by path and re-exports
it. The six structural rules keep their ids; evidence rules (first-
line baseline, footer reverse wrap, divider placement, static cursor,
overlay z-order via renderer hit-test probes, text truncation) report
missing evidence instead of skipping, and concentric radii reject
negative and step-limited radii. Old snapshots still load.
- test-db-harness / affine-test-env: a marker-checked PostgreSQL test
cluster (explicit URL or a reused machine-wide pgvector container),
read-only migration-digest templates with Prisma bookkeeping,
template clones under owner-token leases, and an orphan reaper. Clone,
heartbeat, release and reap serialize per database on an advisory
lock and re-check under it; every maintenance connection re-checks
the cluster marker. Private Redis or a prefix-isolated URL. Images
pinned to multi-arch digests; only private harness containers of the
expected run, by full id, can be removed. run.json reports.
- scripts/ci/check-l0-tier-a.mjs: dependency-free gates for crates/
layering and hygiene, a waitForTimeout/.skip ratchet with per-file
ceilings, workflow references, pinned test images and .gitignore.
- native-playground.yml: resolve the change base to a commit SHA, call
np-web-fast.yml (lint, typecheck, Node-only Vitest projects without
Electron, browser or Rust-binary dependencies) when web sources
change, and always run L0, the frozen server contract checks, crates/
and the parity harness (fmt, clippy, tests against real services).
- Web lint and format: the frozen contract artifacts and
blocksuite/native-playground (checked by its own lane) are ignored via
.prettierignore, from which .oxlintrc.json is generated; the server
contract and parity harness scripts are formatted and lint-clean.
- tools/parity-harness/rustfmt.toml keeps the default style there.
- Remove the copilot cron workflows and the skipped migration spec;
ignore test-results/ and .artifacts/.
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
name: Native Playground Web Fast Checks
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
env:
|
|
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
|
|
SENTRYCLI_SKIP_DOWNLOAD: '1'
|
|
|
|
jobs:
|
|
lint:
|
|
name: Web Lint
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
electron-install: false
|
|
full-cache: true
|
|
|
|
- name: Run oxlint
|
|
run: yarn lint:ox
|
|
|
|
- name: Run i18n codegen
|
|
run: |
|
|
yarn affine @affine/i18n build
|
|
git checkout packages/frontend/i18n/src/i18n-completenesses.json
|
|
|
|
- name: Run oxfmt
|
|
# setup-node may rewrite .yarnrc.yml (nmMode); format-check the tracked file.
|
|
run: |
|
|
git checkout .yarnrc.yml
|
|
yarn lint:format
|
|
|
|
typecheck:
|
|
name: Web Typecheck
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=12288
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
electron-install: false
|
|
full-cache: true
|
|
|
|
- name: Run i18n codegen
|
|
run: |
|
|
yarn affine @affine/i18n build
|
|
git checkout packages/frontend/i18n/src/i18n-completenesses.json
|
|
|
|
- name: Run type check
|
|
run: yarn typecheck
|
|
|
|
unit-test:
|
|
name: Web Unit Test (Node projects)
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
DISTRIBUTION: web
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
electron-install: false
|
|
playwright-install: false
|
|
full-cache: true
|
|
|
|
- name: Run Vitest Node projects
|
|
# Browser-mode, Electron and Rust-binary projects need downloads or
|
|
# builds this lane skips; build-test.yml and js-room-coop run them.
|
|
run: |
|
|
set -euo pipefail
|
|
raw="$(node scripts/ci/vitest-node-projects.mjs)"
|
|
read -r -a projects <<< "$raw"
|
|
test "${#projects[@]}" -gt 0
|
|
yarn vitest run "${projects[@]}"
|