Skip to content

Commit 14736ba

Browse files
chore(phase-8): CI governance, Windows CI lane, scripts, README badge, TODO
1 parent 954057c commit 14736ba

9 files changed

Lines changed: 514 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,35 @@ name: CI
33
on:
44
push:
55
branches: [main]
6+
paths-ignore:
7+
- "docs/**"
8+
- "**/*.md"
9+
- "**/*.png"
10+
- "**/*.svg"
611
pull_request:
712
branches: [main]
13+
paths-ignore:
14+
- "docs/**"
15+
- "**/*.md"
16+
- "**/*.png"
17+
- "**/*.svg"
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: provider-bread-ci-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
env:
25+
VCPKG_COMMIT: "66c0373dc7fca549e5803087b9487edfe3aca0a1"
826

927
permissions:
1028
contents: read
1129

1230
jobs:
13-
foundation:
31+
foundation-linux:
1432
name: Foundation Build and Test (Linux, no hardware)
15-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-24.04
34+
timeout-minutes: 30
1635

1736
steps:
1837
- name: Checkout anolis-provider-bread
@@ -34,24 +53,69 @@ jobs:
3453
path: bread-crumbs-contracts
3554

3655
- name: Install build tools
37-
run: sudo apt-get install -y cmake ninja-build
56+
run: |
57+
sudo apt-get update
58+
sudo apt-get install -y cmake ninja-build g++
3859
3960
- name: Setup vcpkg
4061
uses: lukka/run-vcpkg@v11
4162
with:
42-
vcpkgDirectory: ${{ github.workspace }}/vcpkg
43-
vcpkgJsonGlob: anolis-provider-bread/vcpkg.json
63+
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
64+
doNotCache: false
4465

4566
- name: Configure
4667
working-directory: anolis-provider-bread
47-
env:
48-
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
4968
run: cmake --preset ci-foundation-release
5069

5170
- name: Build
5271
working-directory: anolis-provider-bread
53-
run: cmake --build --preset ci-foundation-release
72+
run: cmake --build --preset ci-foundation-release --parallel
5473

5574
- name: Test
5675
working-directory: anolis-provider-bread
5776
run: ctest --preset ci-foundation-release
77+
78+
foundation-windows:
79+
name: Foundation Build and Test (Windows, no hardware)
80+
runs-on: windows-2022
81+
timeout-minutes: 45
82+
83+
steps:
84+
- name: Checkout anolis-provider-bread
85+
uses: actions/checkout@v4
86+
with:
87+
path: anolis-provider-bread
88+
submodules: recursive
89+
90+
- name: Checkout CRUMBS
91+
uses: actions/checkout@v4
92+
with:
93+
repository: FEASTorg/CRUMBS
94+
path: CRUMBS
95+
96+
- name: Checkout bread-crumbs-contracts
97+
uses: actions/checkout@v4
98+
with:
99+
repository: FEASTorg/bread-crumbs-contracts
100+
path: bread-crumbs-contracts
101+
102+
- name: Setup vcpkg
103+
uses: lukka/run-vcpkg@v11
104+
with:
105+
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
106+
doNotCache: false
107+
108+
- name: Configure
109+
working-directory: anolis-provider-bread
110+
shell: pwsh
111+
run: cmake --preset ci-windows-foundation-release
112+
113+
- name: Build
114+
working-directory: anolis-provider-bread
115+
shell: pwsh
116+
run: cmake --build --preset ci-windows-foundation-release --parallel
117+
118+
- name: Test
119+
working-directory: anolis-provider-bread
120+
shell: pwsh
121+
run: ctest --preset ci-windows-foundation-release

CMakePresets.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@
101101
"cacheVariables": {
102102
"ANOLIS_PROVIDER_BREAD_WARNINGS_AS_ERRORS": "ON"
103103
}
104+
},
105+
{
106+
"name": "ci-windows-foundation-release",
107+
"inherits": "base-windows-msvc",
108+
"cacheVariables": {
109+
"CMAKE_BUILD_TYPE": "Release",
110+
"ANOLIS_PROVIDER_BREAD_ENABLE_HARDWARE": "OFF",
111+
"ANOLIS_PROVIDER_BREAD_WARNINGS_AS_ERRORS": "ON"
112+
}
104113
}
105114
],
106115
"buildPresets": [
@@ -137,6 +146,11 @@
137146
{
138147
"name": "ci-foundation-release",
139148
"configurePreset": "ci-foundation-release"
149+
},
150+
{
151+
"name": "ci-windows-foundation-release",
152+
"configurePreset": "ci-windows-foundation-release",
153+
"configuration": "Release"
140154
}
141155
],
142156
"testPresets": [
@@ -197,6 +211,14 @@
197211
"output": {
198212
"outputOnFailure": true
199213
}
214+
},
215+
{
216+
"name": "ci-windows-foundation-release",
217+
"configurePreset": "ci-windows-foundation-release",
218+
"configuration": "Release",
219+
"output": {
220+
"outputOnFailure": true
221+
}
200222
}
201223
]
202224
}

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# anolis-provider-bread
22

3+
[![CI](https://github.com/FEASTorg/anolis-provider-bread/actions/workflows/ci.yml/badge.svg)](https://github.com/FEASTorg/anolis-provider-bread/actions/workflows/ci.yml)
4+
35
BREAD hardware provider for the Anolis runtime.
46

5-
This repository is intentionally scoped to **BREAD-over-CRUMBS** for the first real hardware provider. It will be implemented with clean internal boundaries so reusable CRUMBS session and bus-management pieces can be extracted later if a broader multi-family use case becomes real.
7+
Implements the Anolis Device Provider Protocol (ADPP) v1 over BREAD-over-CRUMBS, exposing RLHT
8+
and DCMT devices to the Anolis runtime via framed stdio. Supports Linux hardware integration and a
9+
hardware-free foundation build for development and CI.
610

711
Repository documentation:
812

9-
- [docs/README.md](docs/README.md) - committed overview of scope and design decisions
10-
- [docs/build.md](docs/build.md) - current build and dependency workflow
13+
- [docs/README.md](docs/README.md) — scope, design decisions, key rules
14+
- [docs/build.md](docs/build.md) — configure, build, and test workflow
15+
- [docs/troubleshooting.md](docs/troubleshooting.md) — common failure modes and log signatures
16+
- [docs/versioning.md](docs/versioning.md) — provider and dependency version expectations
17+
- [CONTRIBUTING.md](CONTRIBUTING.md) — workspace setup, adding device types, cross-repo workflow

TODO.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# anolis-provider-bread — TODO
2+
3+
Items here are explicitly deferred and intentional. They are not omissions or accidents.
4+
5+
## Hardware CI
6+
7+
- [ ] Add self-hosted CI runner for the Linux hardware path (`ci-linux-release`) against real BREAD devices.
8+
The foundation CI lane (Linux + Windows, no hardware) covers all unit and shell tests.
9+
Hardware-in-the-loop validation requires a dedicated runner; deferred until hardware lab is available.
10+
11+
## ARM64 Support
12+
13+
- [ ] Validate and add `ci-linux-arm64-release` preset and CI lane.
14+
The provider makes no architectural assumptions, but an ARM64 vcpkg triplet and CI runner are needed
15+
to confirm. Deferred until ARM64 deployment target is confirmed.
16+
17+
## CRUMBS Session Extraction
18+
19+
- [ ] Evaluate extracting `src/crumbs/` into a standalone `crumbs-host` or `crumbs-session` library once
20+
a second real CRUMBS-family consumer exists.
21+
Do not extract without a concrete second consumer. The session layer is clean and extractable, but
22+
premature packaging without a real use case creates maintenance burden without benefit.
23+
24+
## Clang-Format / Tidy
25+
26+
- [ ] Configure clang-format and add a CI check or pre-commit hook.
27+
Deferred until the codebase is more stable and a format policy decision is made.
28+
29+
## Additional BREAD Device Types
30+
31+
- [ ] Add adapters for future BREAD device types as new contracts land in `bread-crumbs-contracts`.
32+
Each new type requires: contracts header, compatibility entry, adapter, and tests.
33+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the step-by-step guide.
34+
35+
## Dependency / CVE Scanning
36+
37+
- [ ] Add automated dependency and CVE scanning workflow.
38+
Third-party dependencies (protobuf, yaml-cpp, gtest) come through vcpkg; CRUMBS and bread-crumbs-contracts
39+
are first-party AGPL-3.0. A Dependabot or Trivy scan would catch upstream CVEs.

scripts/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Scripts
22

3-
`scripts/` is reserved for repo-local helper scripts once Phase 1 and Phase 2 introduce repeated build or test workflows.
3+
Helper scripts for common build and test workflows.
44

5-
Phase 0 keeps this directory only to establish the intended layout.
5+
| Script | Purpose |
6+
|--------|---------|
7+
| `build.sh` | Configure and build via CMake preset (Linux/macOS) |
8+
| `build.ps1` | Configure and build via CMake preset (Windows/cross-platform) |
9+
| `test.sh` | Run CTest suite via preset (Linux/macOS) |
10+
| `test.ps1` | Run CTest suite via preset (Windows/cross-platform) |
11+
12+
Each script supports `--help` for usage details.
13+
14+
Default preset on Linux/macOS: `dev-foundation-debug`.
15+
Default preset on Windows: `dev-windows-foundation-debug`.
16+
17+
Test suites: `all` (default), `unit`, `phase1`.

scripts/build.ps1

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env pwsh
2+
# Build anolis-provider-bread via CMake presets.
3+
#
4+
# Usage:
5+
# .\scripts\build.ps1 [options] [-- <extra-cmake-configure-args>]
6+
#
7+
# Options:
8+
# -Preset <name> Configure/build preset (default: dev-windows-foundation-debug on Windows,
9+
# dev-foundation-debug otherwise)
10+
# -Clean Remove preset build directory before configure
11+
# -Jobs <N> Parallel build jobs
12+
# -Help Show help
13+
14+
[CmdletBinding(PositionalBinding = $false)]
15+
param(
16+
[string]$Preset = "",
17+
[switch]$Clean,
18+
[int]$Jobs,
19+
[switch]$Help,
20+
[Parameter(ValueFromRemainingArguments = $true)]
21+
[string[]]$ExtraArgs
22+
)
23+
24+
$ErrorActionPreference = "Stop"
25+
26+
for ($i = 0; $i -lt $ExtraArgs.Count; $i++) {
27+
$arg = $ExtraArgs[$i]
28+
switch -Regex ($arg) {
29+
'^--help$' { $Help = $true; continue }
30+
'^--clean$' { $Clean = $true; continue }
31+
'^--preset$' {
32+
if ($i + 1 -ge $ExtraArgs.Count) { throw "--preset requires a value" }
33+
$i++
34+
$Preset = $ExtraArgs[$i]
35+
continue
36+
}
37+
'^--preset=(.+)$' { $Preset = $Matches[1]; continue }
38+
'^(-j|--jobs)$' {
39+
if ($i + 1 -ge $ExtraArgs.Count) { throw "$arg requires a value" }
40+
$i++
41+
$Jobs = [int]$ExtraArgs[$i]
42+
continue
43+
}
44+
'^--jobs=(.+)$' { $Jobs = [int]$Matches[1]; continue }
45+
'^--$' {
46+
if ($i + 1 -lt $ExtraArgs.Count) {
47+
$ExtraArgs = $ExtraArgs[($i + 1) .. ($ExtraArgs.Count - 1)]
48+
} else {
49+
$ExtraArgs = @()
50+
}
51+
break
52+
}
53+
default { throw "Unknown argument: $arg" }
54+
}
55+
}
56+
57+
if ($Help) {
58+
Get-Content $MyInvocation.MyCommand.Path | Select-Object -First 16
59+
exit 0
60+
}
61+
62+
if (-not $Preset) {
63+
if ($env:OS -eq "Windows_NT") {
64+
$Preset = "dev-windows-foundation-debug"
65+
} else {
66+
$Preset = "dev-foundation-debug"
67+
}
68+
}
69+
70+
if (($env:OS -eq "Windows_NT") -and $Preset -in @("dev-foundation-debug", "dev-foundation-release", "ci-foundation-release")) {
71+
throw "Preset '$Preset' uses Ninja and may not work with MSVC on Windows. Use 'dev-windows-foundation-debug', 'dev-windows-foundation-release', or 'ci-windows-foundation-release'."
72+
}
73+
74+
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
75+
$repoRoot = Split-Path -Parent $scriptDir
76+
$buildDir = Join-Path $repoRoot "build\$Preset"
77+
78+
if ($Clean -and (Test-Path $buildDir)) {
79+
Write-Host "[INFO] Cleaning build directory: $buildDir"
80+
Remove-Item -Recurse -Force $buildDir
81+
}
82+
83+
Write-Host "[INFO] Configure preset: $Preset"
84+
& cmake --preset $Preset @ExtraArgs
85+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
86+
87+
Write-Host "[INFO] Build preset: $Preset"
88+
if ($Jobs -gt 0) {
89+
& cmake --build --preset $Preset --parallel $Jobs
90+
} else {
91+
& cmake --build --preset $Preset --parallel
92+
}
93+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)