Commit Graph

15 Commits

Author SHA1 Message Date
c6859bf9e3 fix(ci): use github.run_number for the email's run link, not run_id
github.run_id is a global counter across the whole Gitea instance (the
same numbering as the 'task NNNN' IDs in the runner's own logs), not
what Gitea's web UI uses in its /actions/runs/<n> URL - that's the
per-repository run_number. The email's 'Ver execução' link pointed at
a run belonging to a different, unrelated repo/workflow entirely.
2026-09-11 18:17:56 -03:00
06439b6b45 fix(ci): use table layout with fully inline CSS for the notification email
The <style>-in-head version rendered broken in the actual mail client
(no card, no colors, no spacing - the email client stripped the style
block, a common limitation of HTML email). Rewrote as a table-based
layout with every style attribute inline, which is the robust approach
for cross-client HTML email compatibility, and added the real Atomenta
logo (https://atomenta.com.br/assets/images/logo_2024.png, the same
asset served by the Atomenta app's own public/assets). Dropped the
dark-mode media query - not expressible with inline-only styles, and
not essential for an internal CI notification.
2026-09-11 15:17:52 -03:00
0e575481cb style(ci): send CI notification email as branded HTML, not plain text
Reused the visual style from the existing Atomenta transactional email
templates (src/views/emails/pedifoods/admin_review_alert.html in the
Atomenta repo) - card container, colored status badge, label/value
details box, dark-mode support. Branding is generic Atomenta (header
and footer), since this notification is shared across all projects on
this CI - only the email Subject names which project it's about
('[PediFoods CI] ...'). Sent as a proper MIME text/html message instead
of the earlier plain-text body.
2026-09-11 15:00:05 -03:00
d400e94d16 feat(ci): email notification on success or failure
Sends an email via the domain's own SMTP (mail.loverde.com.br:587,
STARTTLS) as the last step of both test.yml and beta.yml, using
if: always() so it fires regardless of the job's outcome - subject/body
include job.status, branch, commit and a link to the run. Credentials
(SMTP_USER, SMTP_PASS, NOTIFY_EMAIL_TO) come from repo/org secrets, not
hardcoded here.
2026-09-11 14:36:50 -03:00
6da8b05cfb test(uitests): embed live-state diagnostics in assertion messages, not a file
The file-based diagnostic dump never worked: PediFoodsUITests-Runner
runs as an app inside the simulator, sandboxed to that device's own
container filesystem. NSTemporaryDirectory() called from test code
resolves inside the simulator's data container, invisible to the host
shell's $TMPDIR a later CI step tried to cat - confirmed by the new
step printing 'No UI test diagnostic log was written.' every time.

Replaced with quickDiagnostics(_:), which builds a short live-state
summary (closed-store snackbar, spinning activity indicator, any open
alert, visible 'erro' text, first ~15 visible static texts) and
interpolates it directly into each of the three XCTAssertTrue failure
messages - the one channel already confirmed working end to end on
every run. message: is @autoclosure, so this costs nothing when the
assertion passes. Removed the dead file-write helper and the now-unused
CI step.

See decisions/2026-09-11-ui-test-shared-login-session.md follow-up.
2026-09-11 10:57:48 -03:00
3f99ebcba1 test(uitests): write failure diagnostics to a file, not print()
Confirmed (pasted full CI log around a timeout, searched for the
print()'d marker string, found nothing) that plain print() from inside
a UI test never reaches fastlane's xcodebuild log output on this
runner - its formatter only relays lines matching its own known
patterns and drops everything else.

CartCheckoutFlowTests now writes app.debugDescription to
NSTemporaryDirectory()+'pedifoods_uitest_diag.log' on each of its three
failure points (shared dumpDiagnostics helper, appending), clearing any
stale copy in class setUp(). test.yml gained a step after 'Run tests
with coverage' (if: always()) that cats that file when present - TMPDIR
is stable for the whole CI job, unlike the per-run-hashed workspace
path that broke the original screenshot attempt.

See decisions/2026-09-11-ui-test-shared-login-session.md follow-up.
2026-09-11 10:44:02 -03:00
240cb288bf ci: prune unavailable simulators before running tests
Shared macOS runner accumulates orphaned simulator entries (registry
present, data dir missing on disk) which fail run_tests with 'Unable
to boot device because it cannot be located on disk'. Clean up before
every test run instead of requiring manual simctl intervention.
2026-09-11 09:18:46 -03:00
d698049fab [ci] Move CI to native Mac mini runner, drop Bitrise
- Remove bitrise.yml (no longer used, replaced by Gitea Actions on
  a native macos-build:host runner - Docker VM-based macos-ctl/
  macos-release runners are dead per earlier session)
- test.yml: push-triggered on any branch except develop/release/main,
  runs fastlane tests (coverage) instead of raw xcodebuild
- beta.yml: PR-to-develop triggered, builds + uploads to TestFlight;
  drops the dead wake/sleep-macos-vm jobs, uses the archive-API
  checkout workaround (see go-gitea/gitea#21819), points at the real
  ci-build.keychain-db instead of the old ci-signing.keychain-db name
- release.yml removed: release/main run nothing automated per the
  agreed branch flow, promotion is manual
- Fastfile: add a tests lane (coverage) so the workflow just calls
  fastlane, matching LC Wallet's convention
2026-09-10 20:06:25 -03:00
Daniel Arantes Loverde
7702836fe7 migration 2026-08-11 13:22:02 -03:00
Daniel Arantes Loverde
28f145f392 [macos-runner] Disable credential helper and askpass for checkout clone
17-minute hang on git clone, far past the http.lowSpeedLimit abort
threshold, isn't explained by a data-transfer stall. Now that the VM has
a real GUI session (auto-login), git-credential-osxkeychain could be
popping a GUI dialog nobody's there to dismiss, bypassing
GIT_TERMINAL_PROMPT. Disable the credential helper and force askpass to
fail immediately instead of prompting.
2026-07-31 10:41:36 -03:00
Daniel Arantes Loverde
47cf46e007 [macos-runner] Guard checkout against hanging on prompts or a stalled clone
git clone froze for 9+ minutes on one run with no clear cause. Set
GIT_TERMINAL_PROMPT=0 so it fails fast instead of hanging if credential
auth ever goes wrong, and abort via http.lowSpeedLimit/lowSpeedTime if
the transfer genuinely stalls instead of just being slow.
2026-07-31 09:32:10 -03:00
Daniel Arantes Loverde
d9c2035807 [macos-runner] Replace actions/checkout@v4 with a plain git clone step
actions/checkout@v4 is a JS action, and act_runner's host-executor JS
action path hits a known upstream caching bug on this runner (nested
hostexecutor/.cache/act path never gets the downloaded action, causing
MODULE_NOT_FOUND on every run). Introducing a config.yaml to work around
it (workdir_parent) triggers a separate act_runner bug requiring a Docker
socket that doesn't exist on this Mac. Side-stepping both by doing the
checkout as a plain shell git clone, which the host executor runs fine.
2026-07-30 17:48:47 -03:00
Daniel Arantes Loverde
8af8c7cb5b [macos-runner] Replace SSH-based VM wake/sleep with a dedicated runner container
Drop the SSH + restricted-key design entirely. wake/sleep now runs on a
new macos-ctl runner (its own Docker container on the VPS, Docker socket
mounted) which runs docker start/stop macos directly on the sibling
container - no SSH indirection, and no borrowing of another project's
runner (pedifoods-web) to do it.
2026-07-30 11:57:09 -03:00
Daniel Arantes Loverde
cef21aa160 [macos-runner] Fix wake/sleep jobs to use an actually-registered runner label
runs-on: docker matched no registered runner (labels are macos-release,
atomenta, pedifoods, lc-wallet-web). Use pedifoods, this repo's own
existing always-on runner, to run the wake/sleep SSH steps.
2026-07-30 11:46:04 -03:00
Daniel Arantes Loverde
dda7bbcb17 [macos-runner] Add Gitea Actions workflows for self-hosted macOS CI
Replaces bitrise.yml with equivalent test/beta/release pipelines running
on the self-hosted macos-release runner (act_runner inside a dockur/macos
VM). Each workflow wakes the VM over SSH before the job and stops it
after, since the VM can't be left running 24/7 without starving the
VPS's other services.
2026-07-30 11:35:58 -03:00