diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0954b5c35c..f38eed3f33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,115 +1,17 @@ -name: CI - -# Quality gates for every push to main and every pull request (`cargo xtask ci`), through the -# suite's shared gate workflow in craft-common-actions. Every night the gate runs a cold build: -# the safety net for the workspace crates it keeps between runs (`cache-workspace-crates`), and a -# fresh start for that cache entry. -on: - push: - branches: [main] - schedule: - - cron: "37 3 * * *" - pull_request: - workflow_dispatch: - +name: Diagnose the New Document tile +on: workflow_dispatch permissions: contents: read - -# A newer push to a PR branch cancels its older run; every push to main runs to the end. -concurrency: - group: ci-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - jobs: - gate: - # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. + tile: uses: storytold/craft-common-actions/.github/workflows/gate.yml@main with: - # Same craft-fonts commit as release.yml. craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 - # A cold `cache warm` leg (the nightly run, or any run after a toolchain or lockfile change) - # took 90 minutes to reach its last three steps on 2026-11-27 and was canceled there; with - # those steps and the save it needs about two hours. - timeout-minutes: 150 - # The gate's test binaries carry no debug info and no symbols (CARGO_PROFILE_TEST_DEBUG=0, - # CARGO_PROFILE_TEST_STRIP=symbols), as photocraft's do: linking ~100 test binaries with line - # tables ran the hosted runner out of resources, and it stopped mid-link with "received a - # shutdown signal" (exit 143). Panics still name file and line; local builds keep Cargo.toml's - # line tables. - dev-strip: true - # The workspace crates also build without line tables. A panic still names its file and line. + timeout-minutes: 100 dev-debug: "0" - # Six legs instead of one: shards 1 and 2 each build vectorcraft-ui-egui's tests and run - # half of them, shards 3 to 5 each build and run the tests of their own crates, and shard 6 - # runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate ()` passes only - # when all six did. On pushes to main, a `cache warm` leg builds what every shard builds and - # saves the dependency cache. - test-shards: 6 - shard-command: cargo xtask ci shard - warm-command: cargo xtask ci warm - # The dependency cache also keeps the compiled workspace crates and test executables, so a - # pull request's shards rebuild only the crates its changes reach. Each main run's `cache - # warm` leg saves a rolling entry of its own, every leg restores the newest one, and - # `cache-prune` below deletes the one it replaced. The nightly run restores nothing and - # builds everything from source. - cache-workspace-crates: true - cold-build: ${{ github.event_name == 'schedule' }} + dev-strip: true + cache-name: new-document-tile-probe packages: >- pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev - libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers - libgl1-mesa-dev - - # Keeps one rolling gate entry on main, so the repository stays within its 10 GB Actions cache - # budget. It runs beside the gate and prunes each time the `cache warm` leg finishes saving. A - # failed prune warns instead of failing the run, and cache-prune.yml prunes again after every - # attempt, re-runs of failed jobs included. `watch-minutes` is longer than the gate's - # `timeout-minutes`, so the watch outlasts a cold `cache warm` leg. - cache-prune: - name: cache prune - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - runs-on: ubuntu-24.04 - timeout-minutes: 170 - permissions: - actions: write - steps: - - name: Harden runner - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 - with: - egress-policy: audit - - name: Prune replaced cache entries - uses: storytold/craft-common-actions/actions/cache-prune@main - continue-on-error: true - with: - watch: true - watch-minutes: 160 - saving-jobs: | - ^gate( / cache warm \(.*\))?$ - - # The nightly cold run never restores the rolling crates entry, so the old entry is only overlap - # while the cold run saves its own: two entries of about 4.6 GB, which with the others go over the - # 10 GB cache limit and get the corpus, SonarCloud and Windows ARM64 entries evicted. This deletes - # the old entries when the `cache warm` leg starts saving (scripts/ci-clear-rolling-cache.py). - # When the leg fails or is canceled, before its save or during it, this job fails too, so "Re-run - # failed jobs" runs it again beside the re-run leg. The leg starts after `gate / select legs` and a - # free runner: the script fails when the leg has not started within 120 minutes, and then waits - # up to 160 minutes from the leg's start. This job's timeout is longer than both together, so the - # script reports a leg that starts late with its own error before the job times out. - cold-cache-clear: - name: cold cache clear - if: github.event_name == 'schedule' - runs-on: ubuntu-24.04 - timeout-minutes: 290 - permissions: - actions: write - steps: - - name: Harden runner - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 - with: - egress-policy: audit - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Delete the old rolling entries before the save - env: - GH_TOKEN: ${{ github.token }} - run: python3 scripts/ci-clear-rolling-cache.py + libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers libgl1-mesa-dev + command: python3 scripts/probe-new-document-tile.py diff --git a/scripts/probe-new-document-tile.py b/scripts/probe-new-document-tile.py new file mode 100644 index 0000000000..3124c32051 --- /dev/null +++ b/scripts/probe-new-document-tile.py @@ -0,0 +1,24 @@ +from pathlib import Path +import json +import subprocess + +meta=json.loads(subprocess.check_output(["cargo", "metadata", "--locked", "--format-version", "1"])) +def src(package, file): + p=next(p for p in meta["packages"] if p["name"]==package) + return Path(p["manifest_path"]).parent/file + +def after(path, target, code): + text=path.read_text() + assert text.count(target)==1, (path,target,text.count(target)) + path.write_text(text.replace(target, target+"\n"+code)) + +after(src("craft-ui-patterns","src/patterns/form_dialogs/new_document/cards.rs"), + "let look = Env::of(ui).get::();", + 'eprintln!("VC_TILE actual dialog look={look:?}");') +after(src("craft-ui-widgets","src/tile_grid/tile.rs"), + "fn style(cx: &StyleCx<'_>, key: TileStyleKey) -> TileStyle {", + 'if key.card { eprintln!("VC_TILE style card={:?} actions={:?} baked scrim={:?}",key.card_text,key.action_place,cx.color(cx.tokens.color.surface.scrim.faded(Opacity::TINT)).egui()); }') +after(src("craft-ui-contract","src/primitives/draw.rs"), + "let fill = state.resolve(&look.fill);", + 'if (rect.width()-140.0).abs()<3.0 && (rect.height()-131.0).abs()<3.0 { eprintln!("VC_TILE surface rect={rect:?} state={state:?} fill={:?}",fill.egui()); }') +subprocess.run(["cargo","test","--locked","-p","vectorcraft-ui-egui","--lib","resting_preset_cards_stand_on_a_tile","--","--nocapture"],check=True)