Files
simplex-chat/scripts/ci
Evgeny @ SimpleX Chat ed9e9fe95d mcp, ui: sessions open in the Flat layout, with the avatar on the name line (#8169)
* plan: mcp-flat-sessions

* plan: mcp-flat-sessions, the user's answers

* plan: mcp-flat-sessions, image widths and times per platform

* plan: mcp-flat-sessions, one flat media width and smaller avatars

* plan: mcp-flat-sessions, list breaks

* plan: mcp-flat-sessions, visible avatar gaps and the gap below the sender row

* plan: mcp-flat-sessions, equal gaps around the name

* plan: mcp-flat-sessions, restore the approved gaps

* mcp: open the groups of new sessions in the Flat layout

* ui: avatar on the name line and full-width messages in the flat layout

* ui: record the snapshot references of the flat layout

* ui: flat media beside the go-to button, text below tall name lines

* mcp: source of the session image, Main group check in the e2e test

* plan: mcp-flat-sessions, as implemented

* plans: flat sessions, the tests run on master

* android, desktop: keep the width limit of the media box in intrinsic measurement

* android, desktop: test the intrinsic height of media at an unbounded width

* ui: flat name rows close to their messages, cards at the text edge

* desktop: flat group snapshot references, the media scene

* plans: flat sessions, avatars and flat-layout defects

* desktop: avatar snapshot scenes with photos and placeholders

* ios: flat snapshot references, the deleted items scene

* desktop: avatar snapshot scenes of share, contact and user lists, calls, channel members

* android, desktop: avatars without inner padding, each in its former box

* ios: snapshot scenes of hidden integrity errors in Flat rows and bubbles

* desktop: avatar snapshot references, recorded before the inset removal

* android, desktop: snapshot scenes of hidden integrity errors in Flat rows and bubbles

* ios: hidden integrity errors take no space in the chat

* plans: flat sessions, the user's answers, avatar call sites as implemented, hidden rows

* ios: scenes of the time before deleted items, unread users, appearance

* ios: avatars in Flat rows pass the letters' edge by 2 pt

* ios: 6 pt from the avatar to the message below it in Flat rows

* ios: time on the last line of messages ending with empty lines in Flat

* ios: code cards as wide as the code, the time beside them, in Flat rows

* ios: delivery status only with the time in Flat rows

* ios: time shown on a message before a deleted or hidden item

* ios: no gap below a reactions row between one sender's messages in Flat

* ios: no early wrap of the last word before the time in Flat rows

* ios: name the condition that shows the time before deleted items

* ios: spec links to the moved lines of TerminalItemView

* ios: test of the delivery status without the time in Flat rows

* desktop: snapshot references after the inset removal, hidden integrity error scenes

* android, desktop: blur of blocked members' photos as on iOS

* ios: user picker scene with the chat running, as in the app

* android, desktop: snapshot scenes of the Flat defects and the chat banner

* ios: status without the time only for partial delivery and errors

* ios: snapshot references of the Flat avatar overshoot, gap and defect fixes

* ios: snapshot references without the empty line after a hidden time

* android, desktop: hidden integrity errors take no space; the time before deleted and hidden items

* android, desktop: chat banner 20 dp above its avatar and 10 dp below

* android, desktop: Flat avatars 2 dp past the letters, 6 dp above the text, four layout defects

* android, desktop: share list shows each chat's own avatar

* android, desktop: business, bot and agent placeholders as on iOS

* plans: flat sessions, the decisions as implemented on Android and desktop

* ios: scene of a hidden item between two messages of one sender

* ios: sender name 12 pt after the visible avatar in Flat rows

* ios: rows around hidden items grouped as if the hidden items were absent

* ios: full time in a deleted message bubble

* android, desktop: rows skip hidden items as neighbours; the time before deleted items in Flat rows only

* android, desktop: Flat sender names 12 dp after the avatar

* android, desktop: avatar placeholders from their own assets; unused icons removed

* plans: flat sessions, questions numbered as answered, neighbours of hidden rows, overshoot note

* ios: snapshot references of rows around hidden items and the name start

* android, desktop: hidden rows keep one date separator; marked deleted errors shown; rows rebuilt on the developer setting

* desktop: snapshot references of the Flat decisions, defects, banner and rows around hidden items

* spec, plans: Flat row layout, hidden rows and their neighbours, status with the time; avatar assets as implemented

* android, desktop: new, unread and read statuses only with the time in Flat rows, as on iOS

* desktop: snapshot references of the Flat defects scene with an unread message; plans: partial delivery wording

* mcp: session image with the Flat row geometry: avatar 2 pt past the letters, text 6 pt below it

* mcp: session image with a shorter answer, so the first row shows in full

* ios: user picker snapshot scenes at the height of the sheet

* plans: flat sessions, an avatar column with tighter paddings

* ios: snapshot references of the user picker at the height of the sheet

* plans: flat sessions, the avatar column with only the gap open

* ui: Flat avatar column, the avatar 2 into the padding, text 10 after it

Names, items, later rows of one sender, events and deleted cards sit in the message column; media widths are measured from it. Chats without avatars keep 12 on both sides. The session scene on both platforms; the README image redrawn with the column.

* ui: snapshot references of the Flat avatar column and the session scene

* ui: Flat cards and pills take their corners from the roundness setting

Deleted, marked deleted, moderated, blocked, error and decryption error cards and group invitations: 18 × roundness without a tail, as media, on iOS and Android/desktop. A scene of each platform at roundness 0.3.

* ui: Flat pill text on the text start, sender rows at master's pitch

Deleted, marked deleted, moderated, blocked and error pills start at the message column, so their text lines up with the messages, as on master; in chats without avatars they keep 12 from the screen edge. The name line of a sender row starts at the row gap, as on master; the avatar is centred on it and reaches into the gap above, on both platforms.

* android, desktop: avatars in a box drawn at exactly 5/6 of it, as master's padded placeholders

centeredIn scales its child to 5/6 of the box and centres it with fractional placement, so placeholder edges match master at the pixel at every font scale. Photos and the incognito icon take the same size, up to 1 px larger than master's rounded photo padding. The chat-link thumbnail of the chat list uses the same box, 44 sp.

* android, desktop: avatars in a box at whole pixels, photos fill the drawn box

centeredIn places its child at box/12 rounded down and sizes it to the box less twice that, so placeholders keep master's first and last ink pixel and stay sharp. Photos take their rounded square from the drawn box in pixels.

* ui: photo corners from the nominal size; iOS references of pills, corners and sender rows

The rounded square of a photo keeps its corner radius from the size argument. iOS references for the pill alignment, the corner radius from the roundness setting with a 0.3 scene, and sender rows at master's pitch.

* android, desktop: snapshot references of pills, corners, sender rows and avatars at whole pixels
2026-11-14 22:58:41 +00:00
..

CI on GitHub's runners

Three workflows build the apps from a branch's own code and test them, only when asked: ios-sim (the iOS app in a simulator on a macOS runner), desktop-linux (the desktop app on a Linux runner) and android-emu (the Android app in an emulator on a Linux runner). Each runs a scripted smoke test and, on request, a Claude session that follows a test plan, and a test backend (relay, directory, names server, peers). Details: iOS, desktop, Android.

Reduced build

GitHub runs the reduced build of build.yml on a dispatch (workflow_dispatch), on each push to a draft pull request and on a push to master or stable in a fork. Once the pull request is marked ready for review, GitHub runs the full matrix, as on a push to master or stable in simplex-chat/simplex-chat.

On a push to master or stable in a fork, the release steps and tests are skipped; build-linux saves the -O0 build caches, and on master the Docker image cache, that the fork's dispatches restore.

On a draft pull request, the tests are selected by a fenced block with the info string ci-tests in the description, one hspec match pattern per line; the block is read at each push. / runs the whole suite; without a block, the reduced build runs no tests.

Dispatch

curl -fsS -X POST \
  -H "Authorization: Bearer $GH_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/<owner>/simplex-chat/actions/workflows/build.yml/dispatches \
  -d '{"ref": "<branch>", "inputs": {"tests": "/SimpleX chat client/group tests/\n/Message batching/"}}'

Endpoint: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event. Inputs:

Input Default Value
tests empty hspec match patterns, one per line (\n in JSON); / runs the whole suite, and an empty value builds without tests
base master the branch that the changes are compared with:
stable for a branch cut from stable
the parent branch for a stacked branch

When a newer dispatch on the same branch starts build-linux or build-ios, GitHub cancels the unfinished job of the older one (cancel-in-progress).

Results:

  • Run and jobs: GET /repos/<owner>/simplex-chat/actions/runs?head_sha=<commit>&event=workflow_dispatch returns the run id; GET /repos/<owner>/simplex-chat/actions/runs/<run id>/jobs returns each step with its start, end and conclusion.
  • Job log: GET /repos/<owner>/simplex-chat/actions/jobs/<job id>/logs returns a redirect to a text file, valid for 1 minute (https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run). The test summary is printed as "Finished in N seconds" and "N examples, N failures".

Scopes

The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for every scope except ios, and one macOS job, build-ios (macos-latest), for ios.

core

  • Globs: BUILD_CHANGES["haskell"] in packages_release.py.
  • CI, in build-linux:
    • Docker image (step "Build and cache Docker image");
    • caches (the steps "Restore ... from cache");
    • cabal build -j --enable-tests --ghc-options=-O0 (step "Build CLI");
    • simplex-chat-test with the selected tests (step "Run tests"), each attempt limited to 35 minutes by timeout; an attempt that reaches the limit fails, and "Attempt timed out." is printed.
  • Local:
    cp scripts/cabal.project.local.linux cabal.project.local
    cabal build --enable-tests --ghc-options=-O0
    mkdir -p tests/tmp
    cabal test simplex-chat-test --ghc-options=-O0 --test-option=-m --test-option='/SimpleX chat client/group tests/'
    
    The selection runs as in CI with scripts/ci/run-tests.sh, which appends the patterns of TESTS to the test binary:
    TESTS='/SimpleX chat client/group tests/' scripts/ci/run-tests.sh "$(cabal list-bin simplex-chat-test --ghc-options=-O0)"
    
    --ghc-options=-O0 matches the reduced build; the library and test-suite stanzas of simplex-chat.cabal set -O2. Test directories are created under tests/tmp (tmpBracket in tests/Test.hs).

kotlin

  • Globs: BUILD_CHANGES["kotlin"] in packages_release.py.
  • CI: Gradle in the Docker container of build-linux (step "Build and test Kotlin apps", matrix field kotlin).
  • Local:
    cd apps/multiplatform
    ./gradlew --no-daemon --max-workers=1 :common:desktopTest :desktop:compileKotlinJvm -x :desktop:cmakeBuildAndCopy :android:compileGoogleDebugKotlin :android:testFossDebugUnitTest
    
    JDK 17 and an Android SDK in ANDROID_HOME are required, as installed by Dockerfile.build.

ios

  • Globs:
    • apps/ios/**
    • scripts/ci/ios-stub-libs.sh
  • CI: build-ios: stub libraries, then xcodebuild for the iOS Simulator without signing.
  • Local, on macOS: scripts/ci/ios-stub-libs.sh, then the xcodebuild command of the step "Build iOS app" of build-ios.

packages

  • Globs:
    • packages/simplex-chat-nodejs/**
    • packages/simplex-chat-client/types/typescript/**
    • packages/simplex-chat-python/**
    • scripts/ci/package-tests.sh
  • CI, in build-linux:
    • Node 22 and Python 3.12 (steps "Setup Node.js" and "Setup Python");
    • libsimplex, when CORE_SOURCES of packages_release.py also changed (step "Build library");
    • package-tests.sh build linux-x86_64 and package-tests.sh test (step "Package tests (pull request)").
  • With libsimplex built, SIMPLEX_LIBS_DIR is set to it for the nodejs tests; the python tests run with it unset (package-tests.sh). Without SIMPLEX_LIBS_DIR, the pinned release libraries are downloaded (packages/simplex-chat-nodejs/src/libs.ts).
  • Local:
    scripts/ci/package-tests.sh build linux-x86_64
    scripts/ci/package-tests.sh test
    

badge-web

  • Globs: apps/simplex-badge-service/web/. These paths are also in the core globs (apps/simplex-badge-service/), and web/src/catalog.ts is read by core tests (tests/Bots/BadgeService/CatalogTests.hs, WebTests.hs).
  • CI, in build-linux: core build and tests, then scope-tests.sh badge-web (step "Test changed scopes").
  • Selected core tests: /SimpleX badge service/ and /SimpleX badge service e2e/.
  • Local:
    cd apps/simplex-badge-service/web
    npm ci
    npm test
    

ci-scripts

  • Globs:
    • scripts/ci/packages_release.py
    • scripts/ci/test_packages_release.py
  • CI, in build-linux: scope-tests.sh ci-scripts (step "Test changed scopes").
  • Local: python3 scripts/ci/test_packages_release.py; Python 3.11 or newer is required for tomllib (packages_release.py).

website

  • Globs:
    • website/src/js/simplex-lib.jsc
    • website/test/**
    • website/package.json
  • CI:
    • in build-linux: scope-tests.sh website (step "Test changed scopes");
    • on master pushes: build and deploy of website/, images/, blog/, docs/ and PRIVACY.md (web.yml).
  • Local:
    cd website
    npm test
    

mcp

  • Globs:
    • packages/simplex-chat-mcp/**
    • packages/simplex-chat-nodejs/**
    • packages/simplex-chat-client/types/typescript/**
  • CI:
    • in build-linux: scope-tests.sh mcp (step "Test changed scopes"):
      • the types package and the Node.js library built from the branch without the add-on, as package-tests.sh builds them;
      • npm ci, then both installed into the MCP package with npm install --no-save;
      • npx tsc and npx tsc -p test/tsconfig.json --noEmit;
      • npm test, the unit tests;
      • npm run test:e2e, the end-to-end tests. They download libsimplex and the add-on pinned in packages/simplex-chat-nodejs/src/release.ts, and smp-server and xftp-server of the simplexmq release in test/e2e/smpServer.ts;
    • before a publication: the package with its published dependencies, type-checked and unit tested in job publish of build.yml (docs/contributing/RELEASES.md, "MCP server release").
  • Local: scripts/ci/scope-tests.sh mcp.

support-bot

  • Globs: apps/simplex-support-bot/**.
  • CI, in build-linux: scope-tests.sh support-bot (step "Test changed scopes"): npm ci, npm run build and npm test, with the published simplex-chat and @simplex-chat/types of package-lock.json.
  • The Docker image (scripts/support-bot/Dockerfile) is not built in CI.
  • Local: scripts/ci/scope-tests.sh support-bot.

support-bot-light

  • Globs:
    • apps/simplex-support-bot-light/**
    • packages/simplex-chat-python/**
  • CI, in build-linux: scope-tests.sh support-bot-light (step "Test changed scopes"): the Python library of the branch and the bot installed in a virtual environment, then ruff, pyright and pytest. The tests use a fake API, without libsimplex.
  • Local: scripts/ci/scope-tests.sh support-bot-light.

Scopes lacking CI tests

Scope Paths CI
ios apps/ios/** compile only
types package packages/simplex-chat-client/types/typescript/** compile only
ts-client packages/simplex-chat-client/typescript/** -
webrtc packages/simplex-chat-webrtc/** -
calculator-bot apps/simplex-calculator-bot/** -
prices scripts/prices/** -
nft eth/nft/** -

CI coverage of such a scope is added in the pull request that changes it (Adding CI coverage).

Adding CI coverage

For a scope lacking CI tests, in the pull request that changes it:

  1. scripts/ci/packages_release.py: an entry "<scope>": ["<glob>", ...] in SCOPE_CHANGES.
  2. build.yml, on.pull_request.paths: the same globs; the two are compared in test_build_yml_runs_for_the_paths_of_its_builds of test_packages_release.py.
  3. scripts/ci/scope-tests.sh: a <scope>) case with the build and test commands, and the scope name in the usage line.
  4. scripts/ci/test_packages_release.py, ChangesTest: a case asserting that the scope is printed in scopes for a change to one of its files.
  5. This file, "Scopes": a subsection for the scope, in place of its row in "Scopes lacking CI tests".
  6. Checks: python3 scripts/ci/test_packages_release.py, the new case of scope-tests.sh locally, then a dispatch of the reduced build.

The scope commands run in build-linux after the core tests, with Node 22 and Python 3.12 (steps "Setup Node.js" and "Setup Python"). For a scope that needs other versions, a setup step is added before "Test changed scopes", conditioned on the scope name in needs.maybe-release.outputs.scopes. A scope that needs macOS is a BUILD_CHANGES entry with a separate maybe-release output, as ios is, and a step in build-ios; the if of build-ios includes that output.

Starting a run

Pushes start none of the app workflows: a run is started by hand, on any branch, with inputs that are off by default and combine.

Input iOS Desktop Android
no input scripted test, the app uploaded scripted test, the app uploaded scripted test, the app uploaded
claude scripted test, then Claude scripted test, then Claude scripted test, then Claude
backend also the test backend also the test backend also the test backend
release — also the latest release's onboarding, to tell a branch's failure from the runner's also the latest release's onboarding, to tell a branch's failure from the runner's
armv7a — — also the core library for 32-bit Arm (armeabi-v7a), built only

In the Actions tab: ios-sim, desktop-linux or android-emu → Run workflow, choose the branch and tick the inputs. With the GitHub CLI, each input is a field:

gh workflow run ios-sim.yml --ref <branch>
gh workflow run ios-sim.yml --ref <branch> -f claude=true
gh workflow run desktop-linux.yml --ref <branch> -f claude=true -f backend=true -f release=true
gh workflow run android-emu.yml --ref <branch> -f claude=true

A newer run of a workflow on the same branch cancels the older one.

Each run uploads the app it built, for manual tests, as an artifact kept 14 days: ios-sim-app (SimpleX.app.tar.gz, for the iOS simulator on an Apple-silicon Mac), desktop-app (desktop-app.tar.gz, for Linux x86-64) and android-app (the debug APK, arm64-v8a only). The run's page lists it under Artifacts; gh run download <run id> -n <artifact> downloads it.

How long a run takes

Run iOS Desktop Android
Scripted test, builds reused about 25 min, plus the wait for a macOS runner, which the team's builds share (minutes to an hour) about 10 min about 15 min
The core rebuilt, after Haskell changes 30–45 min more about 25 min more about 27 min more
With the test backend 20–45 min more when it is rebuilt, then about 10 min to start about 30 min more when it is rebuilt, then a few minutes to start as desktop, whose backend it shares
With Claude on the smoke plan 10–15 min more about 4 min more about 5 min more

The Claude job

It needs the GitHub environment app-sim-claude with the secret CLAUDE_CODE_OAUTH_TOKEN, a Claude subscription token. The environment's branch rule alone decides which branches may use it: on a branch it doesn't allow, a run that asks for Claude fails at the Claude job's environment check, and the scripted test runs as usual. Each run spends the subscription's usage limits; the job summary gives its tokens and cost estimated at API prices.