Skip to content
Closed
28 changes: 26 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ on:
pull_request:
branches: [master, main]

# Every other workflow in this repo declares a concurrency group; ci.yml,
# the heaviest one, did not. Pushing twice to a PR left the earlier run
# queued, and both competed for the same scarce windows/macos runners --
# three superseded runs sat ahead of the current one for over an hour.
# cancel-in-progress because a superseded commit's result is not wanted.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# ── Test Matrix ───────────────────────────────────────────────────────────
test:
Expand All @@ -17,7 +26,12 @@ jobs:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-22.04, macos-13, windows-2022]
# macos-latest, not macos-13: the macos-13 image is retired, so jobs
# requesting it queue forever and never get a runner. Across four runs
# on this branch the ubuntu-22.04 and windows-2022 jobs all started and
# finished while the three macos-13 jobs sat queued for over two hours.
# Every other workflow in this repo already uses macos-latest.
os: [ubuntu-22.04, macos-latest, windows-2022]
fail-fast: false

steps:
Expand All @@ -42,8 +56,12 @@ jobs:
run: ruff check . --select=E,F,W --ignore=E501
continue-on-error: true

# --exclude: layers/eosuite/ vendors its own tests/ package, so a bare
# `mypy .` sees two modules named "tests" and bails with "Duplicate
# module named 'tests'" before checking anything. continue-on-error hid
# that the type check was doing no work at all.
- name: Type check (mypy)
run: mypy . --ignore-missing-imports --no-strict-optional
run: mypy . --ignore-missing-imports --no-strict-optional --exclude '^layers/'
continue-on-error: true

# Runs the whole tests/ tree. The previous steps ran only tests/unit/
Expand All @@ -57,7 +75,13 @@ jobs:
# coverage policy already lives in codecov.yml; whether to also
# enforce it here is a maintainer decision, so this change leaves
# both of those numbers alone.
#
# shell: bash — the matrix includes windows-2022, where the default
# shell is PowerShell and the backslash line continuations below are a
# syntax error ("Missing expression after unary operator '--'"), so the
# Windows leg of this job failed before pytest ever started.
- name: Run test suite
shell: bash
run: |
python -m pytest tests/ -v --tb=short \
--cov=ebuild --cov-report=xml --cov-report=term-missing \
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ __pycache__/
*.egg
dist/
build/
# ...but ebuild/build/ is the backend package, not build output. Without
# this a new module added there is silently untracked: git status shows
# nothing at all, so it works locally and is simply absent from the repo.
!ebuild/build/
.eggs/
*.whl

Expand Down
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ Observed in the source tree:
NuttX.
- **Package graph** — install and list project packages
(`ebuild add`, `ebuild list-packages`).
- **Firmware & flashing** — build RTOS firmware and flash images to targets
(`ebuild firmware`, `ebuild flash`; `ebuild/firmware/`).
- **Firmware, flashing & console** — build RTOS firmware, flash images to
targets, and watch them run (`ebuild firmware`, `ebuild flash`,
`ebuild monitor`; `ebuild/firmware/`).
- **Testing** — run the project's tests through the detected backend and report
the runner's own counts (`ebuild test`).
- **System images** — root filesystem, kernel, and disk-image assembly
(`ebuild system`; `ebuild/system/`).
- **Project scaffolding** — generate projects and boards from templates
Expand Down Expand Up @@ -77,6 +80,7 @@ not enough, because ebuild invokes `python -m ninja`.
ebuild info # show what ebuild parsed from build.yaml
ebuild build # resolve and build (auto-detects the backend)
ebuild build -j 4 # build independent packages concurrently
ebuild test # run the project's tests
ebuild clean # remove build artifacts
ebuild --version
```
Expand All @@ -89,6 +93,42 @@ that each package's own build may already run parallel compile jobs, so a large
`-j` can oversubscribe the machine. See
[docs/dependency-management.md](docs/dependency-management.md#parallel-package-builds).

### The golden path

Eight commands from nothing to a running board:

```bash
ebuild setup # fetch eos and eboot
ebuild new hello-eos
cd hello-eos
ebuild configure --board <board>
ebuild build
ebuild test
ebuild flash
ebuild monitor # serial console; Ctrl-C to exit
```

`ebuild test` reports the counts the underlying runner printed, and reports
nothing when the runner printed no summary it recognises — a number inferred
from a zero exit status would be a guess presented as a measurement.

It also treats a run that executed **no tests** as a failure. `ctest` exits `0`
when it finds nothing to run, so trusting the exit status alone would report a
green suite for a project containing no tests at all.

`ebuild monitor` reads the console baud rate from `board.console.baud` or
`monitor.baud` in `build.yaml`, falling back to 115200. It auto-selects the
serial port only when exactly one is present; with several it lists them and
asks, rather than attaching to the wrong board. `ebuild monitor --list` shows
what the host can see.

```yaml
# build.yaml
board:
console:
baud: 9600
```

Additional commands: `configure`, `install`, `add`, `list-packages`,
`pipeline`, `system`, `firmware`, `flash`, `new`, `generate-project`,
`generate-board`, `generate-boot`, `analyze`, `setup`, and the `repos` group
Expand Down
Loading
Loading