Skip to content

Speed up CI: nextest, main-only release builds, one job per phone - #152

Merged
itz4blitz merged 3 commits into
mainfrom
ci/speed
Nov 3, 2026
Merged

itz4blitz merged 3 commits into
mainfrom
ci/speed

Conversation

@itz4blitz

@itz4blitz itz4blitz commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

CI and Mobile were slow for three reasons: the Actions cache was at its 10 GB cap and evicting, tests ran one binary at a time, and a pull request took four macOS runners. This PR changes the following:

ci.yml

  • Tests run under cargo-nextest with a ci profile (.config/nextest.toml). It doesn't stop at the first failure, retries once and reports flaky tests, has a 10-minute hang timeout, and gives the flaky a_channel_posts_comments_count_rides_the_post test 3 tries. Doc tests run with cargo test --doc.
  • macOS makes one pass over the workspace with --features tinyclient/gui instead of two.
  • The macOS and Windows release builds run only on pushes to main. Pull requests still package Linux x86_64.
  • Main now also packages Linux aarch64 on ubuntu-22.04-arm and uploads it as tinyclient-linux-aarch64 (same dist/* layout). It builds without a cache so it stays out of the 10 GB budget.
  • Mobile's host check (cargo check -p tinyclient --features "gui mobile") moves into the Linux test job and uses its cache. That frees the 0.8 GB mobile-host cache.

mobile.yml

  • There is now one job per phone (android-app, ios-app), so the library no longer goes through an artifact and a second runner queue. Artifact names are unchanged: tinyclient-android-debug, tinyclient-ios-unsigned.
  • iOS builds only aarch64-apple-ios (build-ios.sh --device-only) as a staticlib. Android builds only the cdylib (cargo ndk … rustc --crate-type cdylib). Both stay on release and restore main's cache. The 16 KB and zipalign checks stay.
  • I tried a cheaper ci-mobile profile on PRs and dropped it. With no cache for that profile, Android took 19.7 min, against about 11 on release with main's cache.

.config/nextest.toml

  • On Windows, mediad::voice runs one test at a time. native-tls puts every test certificate's key into the same CryptoAPI container ("schannel"), so parallel processes broke each other's TLS handshakes.
  • a_channel_posts_comments_count_rides_the_post gets 3 tries. Other failures get 2 retries, 15s and 30s apart. A Windows runner stalled for about two minutes once, and the immediate retries failed inside the stall.
  • chatd adapters::tiny::live::tests::a_media_drop_finds_a_dead_socket_at_once is left out of the CI run. On Linux it fails every time unless other chatd tests ran earlier in the same process. That includes plain cargo test -p chatd --lib a_media_drop_finds (reproduced on tiny-linux). It's a real test bug and needs its own fix.

Before → after (wall time of each job. After = run 41563801102 / 41563801104. PRs don't save caches, and these jobs compiled cold because their build inputs changed. They should drop once main saves new caches.)

Job Before (median) This PR Notes
test (ubuntu) 18m 14.3m nextest 5.7m (compile ~1.5m, run 4.4m) + gui mobile check 7.1m (cold, no check artifacts in main's cache yet)
test (macOS) 21m 24.2m one pass, compile 14.7m cold (gui feature changes unification), run 7.3m for 1552 tests
test (windows) 16m 10.1m compile 2.3m, run 5.4m
package macOS / windows on PR 17m / 13m not run main only
package linux-x86_64 8m 9.2m unchanged
iOS libs + app 37m + 1m (+ second queue) 22.4m device only, cold deps (staticlib-only changes the LTO dep build)
Android libs + app 12m + 1m 24.9m cold deps for the same reason; ~11m expected once main saves
macOS runners per PR 4 2

🤖 Generated with Claude Code

itz4blitz and others added 3 commits November 2, 2026 19:08
- Tests run under cargo-nextest (all binaries side by side) with a ci profile:
  no fail-fast, a retry that reports flaky tests, a hang timeout, and extra
  tries for the known flaky Telegram comments test. Doc tests run separately.
- macOS tests the workspace once with the gui feature instead of twice.
- macOS and Windows release builds run only on main; pull requests package
  Linux x86_64. Main also packages Linux aarch64 (tinyclient-linux-aarch64),
  without a cache.
- The mobile host check moves into the Linux test job and shares its cache.
- Mobile: one job per phone. iOS builds only the device slice as a staticlib;
  Android only the cdylib. Pull requests use the new ci-mobile profile (no LTO,
  16 codegen units) and no cache; main and tags keep release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- native-tls on Windows imports every test certificate's key into one
  CryptoAPI container, so parallel mediad::voice processes broke each other's
  TLS handshake. They share a one-thread test group on Windows.
- a_media_drop_finds_a_dead_socket_at_once fails on Linux whenever it runs
  without other chatd tests in its process (plain cargo test too), so the ci
  profile leaves it out until the test stands alone.
- Mobile pull requests build release again and restore main's cache. The
  uncached ci-mobile profile took Android from about 11 to 19.7 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Windows runner stalled for a couple of minutes (a 20 MB download test took
131 seconds instead of 5), and the Discord tests retried straight away failed
again inside the stall. Two retries, 15 and 30 seconds later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@itz4blitz
itz4blitz merged commit f1087cb into main Nov 3, 2026
7 checks passed
@itz4blitz
itz4blitz deleted the ci/speed branch November 3, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant