mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-03 04:25:52 -05:00
The CI, FreeBSD, nightly, macOS nightly and release workflows pinned craft-fonts b076417, which has no fonts/latin-manifest.txt, so every build warned that it could not embed the tab-title face. They now pin craft-fonts main at 16bbfc3, which adds Noto Sans Condensed SemiBold (storytold/craft-fonts#72), so builds from these workflows draw document tab titles in it. The pin also brings Noto Sans Lao, Noto Sans for eight Indian scripts (Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada and Malayalam) and the Latin catalog. With the new faces a build loads 135 faces instead of 54, and Retype compares the first 96 first. Two faults showed: - Retype: near matching fits a shape with at most the 256 glyphs closest to it in proportion over every face. The dots and periods of the new faces, drawn alike in each family and each named weight, took all 256 places, so a simplified Source Sans 3 period after "no" matched no glyph of Source Sans 3 and was left as an outline. A shape that near matches no glyph of the font of the line before it is now also compared with that font's own 256 closest glyphs, and joins the line when one fits. RetypeIndex::near_matches_in does that lookup. - Tests: six Retype tests added their test font to the global font database and expected Retype to compare it, which it did only while fewer than 96 faces were loaded before it. They now name the font (type.retype's fonts, or live type in the family as #6896 does for of_two_versions_only_the_one_the_name_gives_is_listed), and lines_in_family fails when the family has no match instead of reading another face. all_supplied_craft_font_families_are_registered_without_system_fonts looked up every embedded craft-fonts face in the document font database. The tab-title face is embedded for tab titles only and the database leaves it out (document_fonts), so the test now checks the faces document_fonts lists. docs/mcp.md describes the new near-match step, and docs/ui-parity.md and docs/localization-parity.md describe the new pin. The pin change and the version test fix follow #6896 by @newsbaba24x7.
116 lines
5.6 KiB
YAML
116 lines
5.6 KiB
YAML
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:
|
|
|
|
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.
|
|
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
|
with:
|
|
# Same craft-fonts commit as release.yml.
|
|
craft-fonts-ref: 16bbfc3d451fad51971ca3f2a28c1e69e279b67c
|
|
# 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.
|
|
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 (<os>)` 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' }}
|
|
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
|