Files
aiturk-mobil/.github/workflows/android.yml
T
7daf73ce0d feat(ui): modern theme, sectioned drawer, shared components (v1) (#1)
* feat(ui): modern theme, sectioned drawer, shared components (v1)

Foundation for the modern redesign — fixes the biggest UX problems
(that vague "better ui ux" ticket) without rewriting all 20 screens
at once. This puts the infrastructure in place and modernizes the
highest-traffic screens.

Theme (
  - Disable Material You dynamic color by default — brand identity
    (Voltage Purple) wins. Can opt back in via HermesControlTheme.
  - 3-step elevation ladder (surface / surfaceVariant / surfaceHigh)
    with subtle blue tint so dark mode stops reading as flat black.
  - Full Material 3 type hierarchy — every style explicitly tuned,
    tighter letter spacing, comfortable line heights.
  - New Shapes.kt (xs→xl rounded corner tokens) and Spacing.kt
    (xs/sm/md/lg/xl/xxl spacing tokens) — no more ad-hoc dp values.

Navigation (
  - Sectioned drawer: 17 items were dumped at one indent level with
    duplicate icons (Channels & Chat both used the Chat icon!). Now
    grouped into 4 logical sections — Converse / Automate / Configure
    / Inspect — with section headers and sane per-item icons.
  - Settings added to the drawer (was previously hidden behind
    ChatScreen's gear icon — bad IA).
  - gesturesEnabled check collapsed from an 18-term OR chain into a
    single set-membership test.

Common components (
  - HermesScaffold: shared drawer-aware Scaffold + TopAppBar with
    slots for refresh / actions. Removes the per-screen duplication
    seen in SkillsScreen, CronJobsScreen, ChannelsScreen, etc.
  - StateViews: LoadingState / ErrorState / EmptyState / list content
    padding tokens — every list screen now renders loading/error/
    empty identically instead of ad-hoc per screen.

Modernized screens:
  - ConnectScreen: hero brand badge (was a lone "⚡" glyph), pairing
    as the primary path, manual token/host/port collapsed behind a
    toggle (was always-visible clutter), Card-in-Card nesting removed.
  - SkillsScreen: now uses HermesScaffold + EmptyState + ErrorState +
    LoadingState. Adds a search field, leading icon per row, and a
    category sublabel.

Follow-up commits will migrate the remaining ~15 list screens onto
HermesScaffold; this commit stops at the foundation + the two screens
that see the most daily use.

Verified: ktlint clean across the entire tree.

Co-Authored-By: Ronia <ronia@m57>

* fix(imports): add missing safeDrawingPadding + dp imports

CI caught three compile errors that ktlint doesn't flag (unresolved
references are not lint errors, they're compile errors):

- Navigation.kt:239  — Modifier.safeDrawingPadding() import was
  dropped when the file was rewritten for the sectioned drawer.
- SkillsScreen.kt:117 — `16.dp` and `12.dp` references had no
  `androidx.compose.ui.unit.dp` import after the file was rewritten
  onto HermesScaffold.

No code changes — pure import fixes.

Co-Authored-By: Ronia <ronia@m57>

* ci: split monolithic job into 4 parallel jobs + summary

Before — one job ran ktlint → lint → test → build sequentially. If
ktlint failed you waited ~30s to find out, and the test/build stages
never even started (no useful artifacts uploaded on partial failure).

After — 4 jobs run in parallel on every push and PR:
  1. ktlint          (fast feedback, ~30s)
  2. android-lint    (parallel, includes compileDebugKotlin)
  3. unit-tests      (parallel, JUnit 5 + mockk)
  4. build           (gated by 1+2+3, only runs if all pass)

Plus a 5th `ci-summary` job that aggregates results so branch
protection only needs a single status check configured.

Other improvements:
- concurrency cancel-in-progress — new commits on the same ref
  cancel the stale run instead of piling up.
- timeout-minutes on every job — no more hung runners burning minutes
  on a stuck Gradle daemon.
- workflow_dispatch — can trigger manually from the Actions tab.
- Per-job artifact uploads with `if: always()` — reports upload even
  when the job fails, so you can download test/lint reports to debug.
- Removed the monolithic "verification-reports" artifact that tried
  to upload three unrelated paths and failed silently with "No files
  were found" when an early step bailed.

Co-Authored-By: Ronia <ronia@m57>

* ci: silence ktlint artifact-not-found annotation

Adds `if-no-files-found: ignore` to the ktlint artifact upload step
because ktlint 1.2.1 does not produce HTML reports on success — only
on failure. The previous config `if-no-files-found: warn` (default)
emitted a noisy annotation on every green run.

Co-Authored-By: Ronia <ronia@m57>

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
Co-authored-by: Ronia <ronia@m57>
2026-06-18 02:59:43 +03:00

192 lines
7.0 KiB
YAML

name: Android CI/CD
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
GRADLE_CACHE_ENCRYPTED_KEY: ${{ secrets.GRADLE_ENCRYPTED_KEY }}
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# Cancel in-progress runs on the same ref when a new commit lands.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─────────────────────────────────────────────────────────────────────
# Job 1: ktlint (code style) — fastest feedback, runs in parallel.
# ─────────────────────────────────────────────────────────────────────
ktlint:
name: ktlint — Code Style
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant Execute Permission for Gradlew
run: chmod +x gradlew
- name: Install ktlint
run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint
chmod +x ktlint
sudo mv ktlint /usr/local/bin/
- name: Run ktlintCheck
run: ./gradlew ktlintCheck
- name: Upload ktlint reports
if: always()
uses: actions/upload-artifact@v4
with:
name: ktlint-reports
path: |
app/build/reports/ktlint/
build/reports/ktlint/
if-no-files-found: ignore
retention-days: 7
# ─────────────────────────────────────────────────────────────────────
# Job 2: Android Lint (static analysis) — runs in parallel with ktlint.
# Depends on compileDebugKotlin, so it also catches unresolved refs.
# ─────────────────────────────────────────────────────────────────────
android-lint:
name: Android Lint — Static Analysis
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant Execute Permission for Gradlew
run: chmod +x gradlew
- name: Run lintDebug
run: ./gradlew lintDebug
- name: Upload lint reports
if: always()
uses: actions/upload-artifact@v4
with:
name: lint-reports
path: app/build/reports/lint-results-debug.*
retention-days: 7
# ─────────────────────────────────────────────────────────────────────
# Job 3: Unit tests — runs in parallel with ktlint & android-lint.
# ─────────────────────────────────────────────────────────────────────
unit-tests:
name: Unit & Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant Execute Permission for Gradlew
run: chmod +x gradlew
- name: Run test
run: ./gradlew test
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: app/build/reports/tests/
retention-days: 7
# ─────────────────────────────────────────────────────────────────────
# Job 4: Build Debug APK — depends on all three above passing.
# ─────────────────────────────────────────────────────────────────────
build:
name: Build Debug APK
needs: [ktlint, android-lint, unit-tests]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant Execute Permission for Gradlew
run: chmod +x gradlew
- name: Build assembleDebug
run: ./gradlew assembleDebug
- name: Upload Debug APK Artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: hermescontrol-debug-apk
path: app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
retention-days: 7
# ─────────────────────────────────────────────────────────────────────
# Job 5: PR status summary — posts a single check that aggregates the
# others, so GitHub branch protection only needs one status check.
# ─────────────────────────────────────────────────────────────────────
ci-summary:
name: CI Summary
needs: [ktlint, android-lint, unit-tests, build]
runs-on: ubuntu-latest
timeout-minutes: 2
if: always()
steps:
- name: Check job results
env:
KTLINT_RESULT: ${{ needs.ktlint.result }}
LINT_RESULT: ${{ needs.android-lint.result }}
TEST_RESULT: ${{ needs.unit-tests.result }}
BUILD_RESULT: ${{ needs.build.result }}
run: |
echo "::notice::ktlint=$KTLINT_RESULT, android-lint=$LINT_RESULT, tests=$TEST_RESULT, build=$BUILD_RESULT"
if [[ "$KTLINT_RESULT" != "success" || "$LINT_RESULT" != "success" || "$TEST_RESULT" != "success" || "$BUILD_RESULT" != "success" ]]; then
echo "::error::One or more CI jobs failed"
exit 1
fi
echo "All CI jobs passed ✅"