Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 19 additions & 11 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI (macOS)

# The build and tests of ci.yml's "Build and test" job, on macOS. Kept apart from ci.yml so that macOS runners, which can
# The tests of ci.yml's verify job, on macOS. Kept apart from ci.yml so that macOS runners, which can
# queue for a long time or not be acquired at all, never hold up or cancel pull requests, main or a release: a failure
# here shows as its own red run and is looked at on its own.
#
Expand Down Expand Up @@ -30,10 +30,24 @@ defaults:

jobs:
verify:
name: Build and test (macos-latest)
name: Test ${{ matrix.project }} (macos-latest)
runs-on: macos-latest
# About 15 minutes of build and 35 or more of the headless control tests (which grow with every component).
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
# The test projects of ci.yml's verify job (#145).
project:
- TKCode.Arc.Foundation.Tests
- TKCode.Arc.Core.Tests
- TKCode.Arc.BaseTheme.Tests
- TKCode.Arc.Tests
- TKCode.Arc.Blocks.Tests
- TKCode.Arc.Special.Tests
- TKCode.Arc.Extras.Tests
- TKCode.Arc.Integration.Tests
- TKCode.Arc.Mobile.Tests
- TKCode.Arc.A2UI.Tests
steps:
- uses: actions/checkout@v7

Expand All @@ -49,11 +63,5 @@ jobs:
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Packages.props', 'build/Versions.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-

- name: Build
run: dotnet build TKCode.Arc.slnx

- name: Test (Core)
run: dotnet test tests/TKCode.Arc.Core.Tests --no-build

- name: Test (controls, headless Avalonia)
run: dotnet test tests/TKCode.Arc.Tests --no-build
- name: Test
run: dotnet test tests/${{ matrix.project }}
37 changes: 23 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

# verify: build and test (Linux) on pushes to main and on pull requests; macOS is ci-macos.yml.
# verify: every test project, one job each (Linux), on pushes to main and on pull requests; macOS is ci-macos.yml.
# templates: creates, builds and starts every dotnet new template case (pushes to main, pull requests).
# pack: packs every TKCode.Arc package (the id lists below) (v* tag, or a manual run).
# nuget: pushes them to nuget.org (v* tag, or a manual run with "publish" on).
Expand Down Expand Up @@ -48,13 +48,29 @@ defaults:

jobs:
verify:
# Linux only: macOS runs the same build and tests in ci-macos.yml, apart from this workflow, so a long wait for a
# macOS runner (or a cancelled macOS job) never holds up or cancels pull requests, main or a release.
name: Build and test (ubuntu-latest)
# Linux only: macOS runs the same tests in ci-macos.yml, apart from this workflow, so a long wait for a macOS runner
# (or a cancelled macOS job) never holds up or cancels pull requests, main or a release. One job per test project, in
# parallel: each builds only its project and what it references (#145). The whole solution is built by the Windows
# job below.
name: Test ${{ matrix.project }} (ubuntu-latest)
if: github.event_name != 'workflow_dispatch' && !startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
# About 10 minutes of build and 30 or more of the headless control tests (which grow with every component).
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# Every headless and pure test project; Video.Native and Pdf.Native need native libraries and have their own jobs.
project:
- TKCode.Arc.Foundation.Tests
- TKCode.Arc.Core.Tests
- TKCode.Arc.BaseTheme.Tests
- TKCode.Arc.Tests
- TKCode.Arc.Blocks.Tests
- TKCode.Arc.Special.Tests
- TKCode.Arc.Extras.Tests
- TKCode.Arc.Integration.Tests
- TKCode.Arc.Mobile.Tests
- TKCode.Arc.A2UI.Tests
steps:
- uses: actions/checkout@v7

Expand All @@ -70,15 +86,8 @@ jobs:
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Packages.props', 'build/Versions.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-

# The same three commands as the Verify section of AGENTS.md.
- name: Build
run: dotnet build TKCode.Arc.slnx

- name: Test (Core)
run: dotnet test tests/TKCode.Arc.Core.Tests --no-build

- name: Test (controls, headless Avalonia)
run: dotnet test tests/TKCode.Arc.Tests --no-build
- name: Test
run: dotnet test tests/${{ matrix.project }}

# Creates every dotnet new template case from freshly packed packages, builds it with warnings as errors and starts it
# headless (tools/templates/verify_templates.py; design/engineering/project-templates.md section 6.3).
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Design source of truth: `design/` (start at `design/overview.md`).
- `src/TKCode.Arc.Core`: ArcDesign tokens, palette, motion engine (`TKCode.Arc.Motion`), shared primitives (`TKCode.Arc.Primitives`), Lucide glyphs.
- `src/TKCode.Arc`: controls, organized as `<Category>/<Component>/` (category = Arc sidebar group).
- `src/TKCode.Arc.Markdown` (`Markdown`, `ChatThread`, `ChatComposer`; `UseArcMarkdown()`) and `src/TKCode.Arc.Highlighting` (TextMate highlighting for `CodeBlock`, the rich text editor and Markdown, installed by `UseArcHighlighting()`; its `ArcHighlightLanguages` targets trim unused grammars): keep StreamMark, Markdig and TextMate out of `TKCode.Arc`. Code there highlights only through the internal `ICodeSyntaxHighlighter` in `Tables/CodeBlock/CodeBlockSyntax.cs`.
- `tests/`: `TKCode.Arc.Core.Tests` (pure), `TKCode.Arc.Tests` (headless Avalonia; the tests that use gallery demos are in ArcGallery), `TKCode.Arc.Foundation.Tests` (runtime + generator snapshots), `TKCode.Arc.BaseTheme.Tests` (base theme in an app with no other theme), `TKCode.Arc.Mobile.Tests`; `tests/Baselines/` holds the token and preset snapshots.
- `tests/`: one project per package, each with a headless app that enables only the packages it tests: `TKCode.Arc.Core.Tests` (pure), `TKCode.Arc.Tests` (the controls of `TKCode.Arc`, Markdown and Highlighting), `TKCode.Arc.Blocks.Tests`, `TKCode.Arc.Special.Tests`, `TKCode.Arc.Extras.Tests` (AdvancedCharts, Dock, Workflow, Terminal, Video, Pdf), `TKCode.Arc.Integration.Tests` (needs every package: token baselines, Pixel and Corners, template contracts), `TKCode.Arc.Foundation.Tests` (runtime + generator snapshots), `TKCode.Arc.BaseTheme.Tests` (base theme in an app with no other theme), `TKCode.Arc.Mobile.Tests`, `TKCode.Arc.A2UI.Tests`, and `Video.Native` / `Pdf.Native` (need the native libraries). Helpers they share are linked source in `tests/Shared/`. The tests that use gallery demos are in ArcGallery; `tests/Baselines/` holds the token and preset snapshots.
- The gallery and documentation site is its own repository, [AIDotNet/ArcGallery](https://github.com/AIDotNet/ArcGallery), checked out next to this one as `../ArcGallery` (its projects find this checkout through `ArcRoot`; section 'Gallery' below). It holds the shell, the docs pages (`Docs/<Category>/<Component>/<lang>.md`), the demos, the screenshots, the generators that build the API tables from this repository's XML docs, the desktop and browser hosts, `tools/docshots` and the tests that go through the demos (`tests/TKCode.Arc.Gallery.Tests`). Design notes: `design/engineering/gallery-app.md`.
- `tools/lucide/generate_lucide.py`: regenerates Lucide glyph geometry: Core's `ArcIcons.g.cs`, the `LucideIconKind` enum of `TKCode.Arc.Icons.Lucide` and the path data of `TKCode.Arc.Icons.Lucide.Generators` (`LucidePaths.txt`). That generator ships in the Icons.Lucide package and compiles only the icons a project uses into it (C#, XAML, `<LucideIcon Include="..." />` items, or `LucideIconsIncludeAll`); repository projects opt in with `ArcLucideGenerator=true`.

Expand Down Expand Up @@ -38,11 +38,11 @@ Read `design/engineering/implementation-guide.md` before writing a component: fi

## Verify

Do not run the full test suites locally (a full `TKCode.Arc.Tests` run takes 8 minutes or more, and much longer when several builds share the machine); CI runs them. Build what you touched and run only the tests for the code you changed:
Do not run the full test suites locally (the headless projects take minutes each, and much longer when several builds share the machine); CI runs every test project as its own job. Build what you touched and run only the tests for the code you changed, in the project of its package:

```bash
dotnet build src/TKCode.Arc -c Debug # or the package you changed
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~<Component>Tests"
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~<Component>Tests" # or Blocks.Tests, Special.Tests, Extras.Tests, ...
```

## Gallery
Expand All @@ -57,4 +57,4 @@ dotnet test tests/TKCode.Arc.Gallery.Tests --filter "FullyQualifiedName~GalleryD

The gallery builds against this checkout (and CI builds it against `main`), so an API change that breaks a demo has to land in both repositories; the libraries' `InternalsVisibleTo` list includes `TKCode.Arc.Gallery.Tests` for the tests that go through the demos.

Run a whole suite only when asked, or for a change that reaches across the library (Core, Foundation, generators, the base theme).
Run a whole suite only when asked, or for a change that reaches across the library (Core, Foundation, generators, the base theme). A new test goes in the project of the package it tests; a test that needs several packages at once goes in `TKCode.Arc.Integration.Tests`, not into another project's test app.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Building needs the .NET 11 SDK (see `global.json`) and the .NET 10 runtime, whic
dotnet build TKCode.Arc.slnx
dotnet test tests/TKCode.Arc.Core.Tests
dotnet test tests/TKCode.Arc.Foundation.Tests
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~ButtonTests" # the whole suite takes 8 minutes or more
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~ButtonTests" # Blocks, Special and the other packages have their own test projects
```

To run the gallery, clone [ArcGallery](https://github.com/AIDotNet/ArcGallery) next to this repository as `../ArcGallery`
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Arc 遵循[语义化版本](https://semver.org/):从 1.0.0 起,破坏性 API
dotnet build TKCode.Arc.slnx
dotnet test tests/TKCode.Arc.Core.Tests
dotnet test tests/TKCode.Arc.Foundation.Tests
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~ButtonTests" # 完整运行需要 8 分钟以上
dotnet test tests/TKCode.Arc.Tests --filter "FullyQualifiedName~ButtonTests" # Blocks、Special 等包各有自己的测试项目
```

要运行组件库站点,请把 [ArcGallery](https://github.com/AIDotNet/ArcGallery) 克隆到本仓库旁边(目录名 `../ArcGallery`,放在别处则用 `ARC_ROOT` 指向本仓库),然后在那里执行
Expand Down
4 changes: 4 additions & 0 deletions TKCode.Arc.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<Project Path="tests/TKCode.Arc.Core.Tests/TKCode.Arc.Core.Tests.csproj" />
<Project Path="tests/TKCode.Arc.BaseTheme.Tests/TKCode.Arc.BaseTheme.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Tests/TKCode.Arc.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Blocks.Tests/TKCode.Arc.Blocks.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Special.Tests/TKCode.Arc.Special.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Extras.Tests/TKCode.Arc.Extras.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Integration.Tests/TKCode.Arc.Integration.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Mobile.Tests/TKCode.Arc.Mobile.Tests.csproj" />
<Project Path="tests/TKCode.Arc.A2UI.Tests/TKCode.Arc.A2UI.Tests.csproj" />
<Project Path="tests/TKCode.Arc.Video.Native.Tests/TKCode.Arc.Video.Native.Tests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Audio/TKCode.Arc.Audio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Core.Tests" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Blocks/TKCode.Arc.Blocks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Core/TKCode.Arc.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<InternalsVisibleTo Include="TKCode.Arc.Markdown" />
<InternalsVisibleTo Include="TKCode.Arc.Core.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.BaseTheme.Tests" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Dock/TKCode.Arc.Dock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Highlighting/TKCode.Arc.Highlighting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Markdown/TKCode.Arc.Markdown.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Pdf/TKCode.Arc.Pdf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Pdf.Native.Tests" />
<!-- PdfDateText, shared by the backends. -->
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Special/TKCode.Arc.Special.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Terminal/TKCode.Arc.Terminal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<InternalsVisibleTo Include="TKCode.Terminal.Core.Tests" />
<InternalsVisibleTo Include="TKCode.Terminal.Avalonia.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
<!-- libghostty-vt per RID. The binaries are not committed: tools/terminal/build-ghostty.sh (+ build-ghostty-ios.sh) builds them
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Video/TKCode.Arc.Video.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Video.Native" />
<InternalsVisibleTo Include="TKCode.Arc.Video.Browser" />
Expand Down
4 changes: 4 additions & 0 deletions src/TKCode.Arc.Workflow/TKCode.Arc.Workflow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/TKCode.Arc/TKCode.Arc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="TKCode.Arc.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Blocks.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Special.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Extras.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Integration.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.Gallery.Tests" />
<InternalsVisibleTo Include="TKCode.Arc.AdvancedCharts" />
<!-- The split-out packages (ADR 0050) use the code-highlighting contract, palettes and shared parts. -->
Expand Down
Loading
Loading