Skip to content

Read the screen without silencing a screen reader (dump backend) #229

Read the screen without silencing a screen reader (dump backend)

Read the screen without silencing a screen reader (dump backend) #229

Workflow file for this run

# Everything that can be checked without a device.
#
# The job body is `make ci` rather than a list of steps, so this file and a
# person checking before a commit run exactly the same thing. Adding a check
# here without adding it to the Makefile would give CI a coverage the
# developer cannot reproduce, which is how a green build starts meaning less
# than it should.
#
# What this deliberately does NOT cover is in docs/RELEASE-CHECKLIST.md.
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
# A newer push to the same branch makes an in-flight run irrelevant.
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Build, vet and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
# Read from go.mod so the version is stated once. Both modules
# declare the same one; the root is the source of truth.
go-version-file: go.mod
# Two modules, so both lock files matter to the cache key.
cache-dependency-path: |
go.sum
clients/go/go.sum
- uses: actions/setup-node@v7
with:
node-version: '22'
# The Java client builds through its Maven wrapper, which fetches a
# pinned, checksum-verified Maven and the pinned plugins; the client
# itself has no dependencies. The cache keeps those downloads between
# runs.
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
cache-dependency-path: clients/java/pom.xml
# The .NET client targets netstandard2.0 and its tests run on the
# SDK's own runtime, so the SDK is all that is needed -- no NuGet
# restore, because the client has no dependencies.
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
# Pinned and checksum-verified by the Makefile, so CI and a developer's
# machine run the same linter at the same version.
- name: Install golangci-lint
run: make lint-install
- name: make ci
run: make ci
- name: Build the binary
run: make build
# A smoke test that the thing that just built actually runs. `--help`
# exercises the whole cobra command tree, which has caught a duplicate
# command registration before it reached anyone.
- name: Smoke test
run: |
./bin/mobium --version
./bin/mobium --help > /dev/null
test "$(./bin/mobium --help | grep -cE '^ [a-z-]+ ')" -ge 20
# The .NET client on Windows, where it is most likely to be used and where
# the command line it hand-quotes is parsed by CommandLineToArgvW. Its tests
# start a fake `mobium pipe` (the test program itself), so no mobium binary
# is needed -- which is why this can run before the daemon supports Windows.
dotnet-windows:
name: .NET client on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: make dotnet
shell: bash
run: make dotnet
# Everything Windows can be checked on without a device: the Go tests of
# both modules -- internal/daemon's start a real daemon over the named pipe,
# check it is owner-only while it runs and gone after -- and then the built
# binary, which the tests do not cover. docs/WINDOWS.md, "Doing the work".
# Passing here is not G7: nothing below drives a device.
go-windows:
name: Go and the daemon on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
clients/go/go.sum
# docs/WINDOWS.md's acceptance criteria for the transport, first and on
# their own, so they report even while the rest of the suite does not
# pass on Windows. A hang here is a shutdown that never finishes. Five
# times over, because a shutdown on Windows has overrun once in three.
- name: Daemon transport tests
shell: bash
run: go test -timeout 5m -count 5 ./internal/daemon/ ./internal/paths/
# Not `make build`: its output has no .exe, and Windows will not run it.
- name: Build mobium.exe
if: success() || failure()
shell: bash
run: go build -o bin/mobium.exe ./cmd/mobium
- name: Smoke test
if: success() || failure()
shell: bash
run: |
set -euo pipefail
m=./bin/mobium.exe
$m --version
$m --help > /dev/null
# doctor runs in-process and must work with nothing installed; its
# verdict on this runner is not the point, finishing is.
$m doctor || echo "doctor exited $?"
# mcp runs the tool layer in-process on stdio and never touches the
# daemon, so it is claimed to work here already. Check the claim.
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| timeout 60 $m mcp > mcp.out
grep -q '"id":2' mcp.out
grep -q '"app_map"' mcp.out
echo "mcp: tools/list answered"
# The daemon through the CLI: auto-start goes through setDetached
# and a real child process, which no test reaches. Read the state
# back each time rather than trusting an exit code.
$m daemon status | tee status.out
grep -q 'not running' status.out
timeout 120 $m devices || echo "devices exited $?"
$m daemon status | tee status.out
grep -q 'Daemon running' status.out
$m daemon stop
$m daemon status | tee status.out
grep -q 'not running' status.out
# Everything else. Much of it is not yet written for Windows -- fakes
# that are shell scripts, executable bits -- and this is what says so.
- name: make test
if: success() || failure()
shell: bash
run: make test