diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..4ce41f1 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,43 @@ +# Android: built on JQ's home cluster (EDITH) self-hosted runners. +# +# jvm-core the pure-JVM trust layer (meshkit-core) on the Omarchy machine +# android the Android library (meshkit-transport-intent, compileSdk 36) on the Windows +# machine's WSL, which has the Android SDK (edith deploy/ci/setup-android-sdk.sh) +# +# Self-hosted runners run whatever a workflow says, and this repository is public, so these +# jobs never run for pull requests (a fork could change the workflow). Pushes need write +# access to this repository, so any branch pushed here may use them. +name: android +on: + push: + paths: ["meshkit-android/**", ".github/workflows/android.yml"] + workflow_dispatch: +permissions: + contents: read +concurrency: + group: android-${{ github.ref }} + cancel-in-progress: true +jobs: + jvm-core: + name: meshkit-core (JVM) + runs-on: [self-hosted, linux, omarchy] + timeout-minutes: 30 + defaults: + run: + working-directory: meshkit-android + steps: + - uses: actions/checkout@v4 + - run: java -version && gradle --version + - run: gradle --no-daemon --stacktrace :meshkit-core:test + + android: + name: meshkit-transport-intent (Android SDK) + runs-on: [self-hosted, linux, android] + timeout-minutes: 60 + defaults: + run: + working-directory: meshkit-android + steps: + - uses: actions/checkout@v4 + - run: test -n "$ANDROID_HOME" && gradle --version + - run: gradle --no-daemon --stacktrace build diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 0000000..39d5f60 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,49 @@ +# iOS: the MeshKit Swift package and the three sample apps. +# +# iOS needs Xcode, which runs only on macOS (MeshKit also imports CryptoKit, which has no +# Linux build), so these jobs use GitHub-hosted macOS runners. They are free for public +# repositories and safe for pull requests. The Linux side of the cluster (omarchy runner) +# covers the pure-JVM trust layer in android.yml. +name: ios +on: + push: + branches: [main] + paths: ["meshkit-ios/**", ".github/workflows/ios.yml"] + pull_request: + paths: ["meshkit-ios/**", ".github/workflows/ios.yml"] + workflow_dispatch: +permissions: + contents: read +concurrency: + group: ios-${{ github.ref }} + cancel-in-progress: true +jobs: + package: + name: MeshKit package (build + test) + runs-on: macos-15 + timeout-minutes: 30 + defaults: + run: + working-directory: meshkit-ios + steps: + - uses: actions/checkout@v4 + - run: swift --version + - run: swift build + - run: swift test + + apps: + name: Sample apps (iOS Simulator, unsigned) + runs-on: macos-15 + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + scheme: [HermesChat, MintNotes, DailyMart] + steps: + - uses: actions/checkout@v4 + - name: Build ${{ matrix.scheme }} + working-directory: meshkit-ios/Samples/iOSDemo + run: | + xcodebuild -project MeshKitiOSDemo.xcodeproj -scheme "${{ matrix.scheme }}" \ + -destination 'generic/platform=iOS Simulator' -derivedDataPath "$RUNNER_TEMP/dd" \ + CODE_SIGNING_ALLOWED=NO build | tail -n 40 # bash -eo pipefail: a failed build fails the step diff --git a/meshkit-android/build.gradle.kts b/meshkit-android/build.gradle.kts index b6ff246..3e18c2a 100644 --- a/meshkit-android/build.gradle.kts +++ b/meshkit-android/build.gradle.kts @@ -1,4 +1,10 @@ plugins { kotlin("jvm") version "2.2.20" apply false kotlin("plugin.serialization") version "2.2.20" apply false + // Declared here (not applied) so the Android Gradle Plugin and the Kotlin Android plugin + // load in the same classloader as the Kotlin plugin above; otherwise kotlin("android") + // in a subproject cannot see AGP's classes (NoClassDefFoundError: BaseVariant). + // Versions come from settings.gradle.kts pluginManagement. + id("com.android.library") apply false + kotlin("android") apply false } diff --git a/meshkit-android/gradle.properties b/meshkit-android/gradle.properties new file mode 100644 index 0000000..494c47a --- /dev/null +++ b/meshkit-android/gradle.properties @@ -0,0 +1,4 @@ +# The Android module (meshkit-transport-intent) depends on AndroidX (androidx.activity). +android.useAndroidX=true +org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 +kotlin.code.style=official