Fix Android VPN startup state and duplicate connect handling #217
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android Compile Check | |
| # Builds the debug APK and runs native unit tests on PRs that change Kotlin or | |
| # Gradle files, to catch regressions before they reach main. The full signed | |
| # release build (build-android.yml) is workflow_call-only and never runs on PRs, | |
| # so without this gate a Kotlin break (e.g. the bare success() call in #8754) | |
| # could merge undetected. | |
| # | |
| # Scope: the PR trigger covers Kotlin, Android Gradle, and shared CI setup changes. It | |
| # does NOT run on Go/gomobile-AAR or Flutter/dep changes — a Go change that | |
| # breaks the AAR<->Kotlin interface would surface in build-android.yml / | |
| # release, not here. workflow_dispatch exists only for benchmarking/debugging. | |
| # | |
| # Debug build only: no keystore/APP_ENV secrets, no AAB, no artifact upload. | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - "**/*.kt" | |
| - "android/**/*.gradle" | |
| # keep the self-trigger so edits to this workflow re-run it | |
| - ".github/workflows/android-compile-check.yml" | |
| - ".github/actions/setup-android/**" | |
| - ".github/actions/setup-flutter/**" | |
| - ".github/actions/setup-go/**" | |
| concurrency: | |
| group: android-compile-check-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| compile-check: | |
| permissions: | |
| contents: "read" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: ./.github/actions/setup-go | |
| with: | |
| cache-scope: android-check | |
| gomobile-cache: "true" | |
| - name: Set up Android | |
| uses: ./.github/actions/setup-android | |
| - name: Install Flutter | |
| uses: ./.github/actions/setup-flutter | |
| - name: Cache Android AAR | |
| id: android-aar-cache | |
| uses: actions/cache@v4 | |
| timeout-minutes: 5 | |
| continue-on-error: true | |
| with: | |
| path: | | |
| bin/android/liblantern.aar | |
| android/app/libs/liblantern.aar | |
| key: ${{ runner.os }}-android-aar-${{ hashFiles('go.mod', 'go.sum', 'Makefile', '**/*.go', '.github/actions/setup-android/**', '.github/actions/setup-flutter/**', '.github/actions/setup-go/**') }} | |
| - name: Mark restored Android AAR fresh | |
| if: steps.android-aar-cache.outputs.cache-hit == 'true' | |
| run: | | |
| test -s bin/android/liblantern.aar | |
| test -s android/app/libs/liblantern.aar | |
| touch bin/android/liblantern.aar android/app/libs/liblantern.aar | |
| - name: Install dependencies (gomobile) | |
| if: steps.android-aar-cache.outputs.cache-hit != 'true' | |
| run: make install-android-deps | |
| env: | |
| GOMOBILECACHE: ${{ env.GOMOBILECACHE }} | |
| - name: Flutter pub get + codegen | |
| run: | | |
| make pubget | |
| make gen | |
| # app.env is a declared pubspec asset, normally decoded from a secret by | |
| # the release workflow. This compile-only gate doesn't run the app, so an | |
| # empty placeholder is enough to satisfy asset bundling without the secret. | |
| - name: Create placeholder app.env | |
| run: touch app.env | |
| # Uses the cached gomobile AAR when possible, then compiles the debug APK | |
| # (all app Kotlin). A Kotlin compile error fails this step — the whole | |
| # point of the gate. | |
| - name: Build debug APK (compiles Kotlin) | |
| run: make android-debug-ci | |
| env: | |
| GOMOBILECACHE: ${{ env.GOMOBILECACHE }} | |
| - name: Run Android unit tests | |
| working-directory: android | |
| run: ./gradlew :app:testDebugUnitTest |