Prepare reproducible F-Droid release #14
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| native-tests: | |
| name: Native Go tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: native/go.mod | |
| cache-dependency-path: native/go.sum | |
| - name: Run native tests with the race detector | |
| working-directory: native | |
| run: go test -race ./... | |
| android-tests: | |
| name: Android tests and checks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| cache: gradle | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: native/go.mod | |
| cache-dependency-path: native/go.sum | |
| - name: Install Android SDK components | |
| run: | | |
| sdkmanager="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" | |
| if [[ ! -x "$sdkmanager" ]]; then | |
| echo "sdkmanager is unavailable at $sdkmanager" >&2 | |
| exit 1 | |
| fi | |
| yes | "$sdkmanager" --licenses >/dev/null || true | |
| "$sdkmanager" \ | |
| "platforms;android-35" \ | |
| "build-tools;34.0.0" \ | |
| "ndk;29.0.14206865" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/29.0.14206865" >> "$GITHUB_ENV" | |
| - name: Install gomobile | |
| run: | | |
| go install golang.org/x/mobile/cmd/gomobile@v0.0.0-20260821190718-4776eadac327 | |
| gomobile init | |
| - name: Build arm64 Android AAR | |
| working-directory: native | |
| run: | | |
| mkdir -p ../app/libs | |
| gomobile bind \ | |
| -target=android/arm64 \ | |
| -androidapi 26 \ | |
| -trimpath \ | |
| -o ../app/libs/megaproxy.aar \ | |
| ./mobile | |
| - name: Run Android unit tests, lint, and debug build | |
| run: ./gradlew --no-daemon testDebugUnitTest lintDebug assembleDebug |