Full project refactor: dead-code purge + Kotlin/Compose modernization + Rust JNI hardening + build tooling #109
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 Build | |
| on: | |
| push: | |
| branches: [ master, main, 'claude/**', 'feature/**', 'test/**', 'refactor/**' ] | |
| pull_request: | |
| branches: [ master, main, 'feature/**', 'refactor/**' ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK and CMake | |
| run: | | |
| sdkmanager --install "ndk;25.1.8937393" "cmake;3.22.1" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| echo "NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| - name: Setup Rust toolchain (Android targets for proxydroid-tun2socks) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| app/src/main/rust/proxydroid-tun2socks/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create local.properties | |
| run: | | |
| echo "sdk.dir=$ANDROID_HOME" > local.properties | |
| echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug --stacktrace | |
| - name: Upload Debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 7 | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK and CMake | |
| run: | | |
| sdkmanager --install "ndk;25.1.8937393" "cmake;3.22.1" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| echo "NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| - name: Setup Rust toolchain (Android targets for proxydroid-tun2socks) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| app/src/main/rust/proxydroid-tun2socks/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create local.properties | |
| run: | | |
| echo "sdk.dir=$ANDROID_HOME" > local.properties | |
| echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties | |
| - name: Run Lint | |
| run: ./gradlew lint --stacktrace | |
| continue-on-error: true | |
| - name: Upload Lint Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: lint-results | |
| path: app/build/reports/lint-results*.html | |
| retention-days: 7 | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK and CMake | |
| run: | | |
| sdkmanager --install "ndk;25.1.8937393" "cmake;3.22.1" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| echo "NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| - name: Setup Rust toolchain (Android targets for proxydroid-tun2socks) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| app/src/main/rust/proxydroid-tun2socks/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create local.properties | |
| run: | | |
| echo "sdk.dir=$ANDROID_HOME" > local.properties | |
| echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties | |
| - name: Run Unit Tests | |
| run: ./gradlew testDebugUnitTest --stacktrace | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| app/build/reports/tests/ | |
| app/build/test-results/ | |
| retention-days: 7 | |
| emulator-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK and CMake | |
| run: | | |
| sdkmanager --install "ndk;25.1.8937393" "cmake;3.22.1" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| echo "NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV | |
| - name: Setup Rust toolchain (Android targets for proxydroid-tun2socks) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| app/src/main/rust/proxydroid-tun2socks/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create local.properties | |
| run: | | |
| echo "sdk.dir=$ANDROID_HOME" > local.properties | |
| echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug --stacktrace | |
| - name: Start HTTP Proxy Server | |
| run: | | |
| chmod +x scripts/test_http_proxy.py | |
| python3 scripts/test_http_proxy.py --port 8888 & | |
| echo "PROXY_PID=$!" >> $GITHUB_ENV | |
| sleep 2 | |
| echo "HTTP proxy started on port 8888" | |
| - name: Create proxy preferences file | |
| run: | | |
| cat > /tmp/prefs.xml << 'EOF' | |
| <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | |
| <map> | |
| <string name="host">10.0.2.2</string> | |
| <string name="port">8888</string> | |
| <string name="proxyType">http</string> | |
| <boolean name="isVpnMode" value="true" /> | |
| <boolean name="isAutoConnect" value="false" /> | |
| <boolean name="isAuth" value="false" /> | |
| <string name="user"></string> | |
| <string name="password"></string> | |
| <boolean name="isRunning" value="false" /> | |
| <boolean name="isBypassApps" value="false" /> | |
| <string name="bypassAddrs"></string> | |
| <boolean name="isGlobalProxy" value="true" /> | |
| </map> | |
| EOF | |
| - name: Run Emulator Tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 29 | |
| arch: x86_64 | |
| profile: Nexus 6 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: bash scripts/run_emulator_tests.sh | |
| - name: Stop HTTP Proxy | |
| if: always() | |
| run: | | |
| if [ -n "$PROXY_PID" ]; then | |
| kill $PROXY_PID 2>/dev/null || true | |
| fi | |
| - name: Upload Test Logs | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: emulator-test-logs | |
| path: | | |
| app/build/outputs/ | |
| retention-days: 7 |