formatting changes
CI / Gateway plugin tests (push) Successful in 4m43s
CI / Kotlin tests (android host + desktop) (push) Successful in 6m58s

This commit is contained in:
ARIA committed 2026-08-22 11:07:24 +02:00
1 parent c71636ad55
commit 3a33f6be15
2 files changed
+114 -95

No files matched your search

+65 -65
View File
@@ -1,79 +1,79 @@
name: CI name: CI
on: on:
push: push:
branches: [master] branches: [master]
pull_request: pull_request:
jobs: jobs:
gateway: gateway:
name: Gateway plugin tests name: Gateway plugin tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install uv - name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh run: curl -LsSf https://astral.sh/uv/install.sh | sh
# The gateway tests run inside the hermes-agent test harness, which is # The gateway tests run inside the hermes-agent test harness, which is
# git-ignored in this repo (read-only research reference). CI clones the # git-ignored in this repo (read-only research reference). CI clones the
# upstream repo at a pinned commit and drops in the vendored test copy. # upstream repo at a pinned commit and drops in the vendored test copy.
# Bump the pinned SHA when you update the local hermes-agent checkout. # Bump the pinned SHA when you update the local hermes-agent checkout.
- name: Clone hermes-agent (pinned) - name: Clone hermes-agent (pinned)
run: | run: |
git clone https://github.com/NousResearch/hermes-agent.git hermes-agent git clone https://github.com/NousResearch/hermes-agent.git hermes-agent
git -C hermes-agent fetch --depth 1 origin 31f62d76af068abde3c699f91190e8ded07fd05b git -C hermes-agent fetch --depth 1 origin 31f62d76af068abde3c699f91190e8ded07fd05b
git -C hermes-agent checkout 31f62d76af068abde3c699f91190e8ded07fd05b git -C hermes-agent checkout 31f62d76af068abde3c699f91190e8ded07fd05b
- name: Sync venv - name: Sync venv
run: | run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "$HOME/.local/bin" >> "$GITHUB_PATH"
cd hermes-agent cd hermes-agent
# pytest lives in the `dev` extra — a plain `uv sync` leaves the # pytest lives in the `dev` extra — a plain `uv sync` leaves the
# venv without it and run_tests.sh refuses to run. # venv without it and run_tests.sh refuses to run.
uv sync --extra dev uv sync --extra dev
- name: Run android gateway tests - name: Run android gateway tests
run: | run: |
cp gateway-plugin/tests/test_android.py hermes-agent/tests/gateway/test_android.py cp gateway-plugin/tests/test_android.py hermes-agent/tests/gateway/test_android.py
cd hermes-agent cd hermes-agent
ANDROID_PLUGIN_DIR="$GITHUB_WORKSPACE/gateway-plugin" \ ANDROID_PLUGIN_DIR="$GITHUB_WORKSPACE/gateway-plugin" \
scripts/run_tests.sh tests/gateway/test_android.py scripts/run_tests.sh tests/gateway/test_android.py
kotlin: kotlin:
name: Kotlin tests (android host + desktop) name: Kotlin tests (android host + desktop)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-java@v4 - uses: actions/setup-java@v4
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "21"
# gradle.properties pins org.gradle.java.home to a local JDK path; # gradle.properties pins org.gradle.java.home to a local JDK path;
# strip it so CI uses the JDK installed by setup-java. # strip it so CI uses the JDK installed by setup-java.
- name: Strip local JDK pin - name: Strip local JDK pin
run: sed -i '/^org\.gradle\.java\.home/d' app/gradle.properties run: sed -i '/^org\.gradle\.java\.home/d' app/gradle.properties
- name: Install Android SDK - name: Install Android SDK
run: | run: |
export ANDROID_HOME="$HOME/android-sdk" export ANDROID_HOME="$HOME/android-sdk"
mkdir -p "$ANDROID_HOME/cmdline-tools" mkdir -p "$ANDROID_HOME/cmdline-tools"
curl -fsSL -o /tmp/ct.zip \ curl -fsSL -o /tmp/ct.zip \
https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip -q /tmp/ct.zip -d "$ANDROID_HOME/cmdline-tools" unzip -q /tmp/ct.zip -d "$ANDROID_HOME/cmdline-tools"
mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest"
# Finite input from a file: `yes | sdkmanager` dies with SIGPIPE # Finite input from a file: `yes | sdkmanager` dies with SIGPIPE
# (exit 141) under Gitea's `bash -e -o pipefail` once sdkmanager # (exit 141) under Gitea's `bash -e -o pipefail` once sdkmanager
# exits before `yes` is done writing. # exits before `yes` is done writing.
for i in $(seq 100); do echo y; done > /tmp/sdk_licenses_yes.txt for i in $(seq 100); do echo y; done > /tmp/sdk_licenses_yes.txt
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses < /tmp/sdk_licenses_yes.txt > /dev/null "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses < /tmp/sdk_licenses_yes.txt > /dev/null
echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV"
echo "sdk.dir=$ANDROID_HOME" > app/local.properties echo "sdk.dir=$ANDROID_HOME" > app/local.properties
# Host-side tests only (no device needed). AGP auto-downloads the # Host-side tests only (no device needed). AGP auto-downloads the
# missing SDK platforms (licenses accepted above). # missing SDK platforms (licenses accepted above).
- name: Run host tests - name: Run host tests
working-directory: app working-directory: app
run: ./gradlew :shared:testAndroidHostTest :shared:desktopTest run: ./gradlew :shared:testAndroidHostTest :shared:desktopTest
+49 -30
View File
@@ -12,11 +12,12 @@ val arch = System.getProperty("os.arch") ?: "amd64"
// CI passes -PappVersion=<version> (release workflow); local builds keep the // CI passes -PappVersion=<version> (release workflow); local builds keep the
// default. jpackage requires a plain semver (no leading "v"). // default. jpackage requires a plain semver (no leading "v").
val appVersion = (project.findProperty("appVersion") as? String) ?: "0.1.0" val appVersion = (project.findProperty("appVersion") as? String) ?: "0.1.0"
val desktopTarget = when { val desktopTarget =
os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64" when {
os.isWindows -> "windows-x64" os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64"
else -> if (arch == "aarch64") "linux-arm64" else "linux-x64" os.isWindows -> "windows-x64"
} else -> if (arch == "aarch64") "linux-arm64" else "linux-x64"
}
dependencies { dependencies {
implementation(project(":shared")) implementation(project(":shared"))
@@ -48,19 +49,21 @@ afterEvaluate {
val jpackageInputDir = layout.buildDirectory.dir("jpackage-input") val jpackageInputDir = layout.buildDirectory.dir("jpackage-input")
val fatJar = tasks.register<Jar>("fatJar") { val fatJar =
archiveClassifier.set("all") tasks.register<Jar>("fatJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE archiveClassifier.set("all")
manifest { attributes("Main-Class" to "iris.desktop.MainKt") } duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output) manifest { attributes("Main-Class" to "iris.desktop.MainKt") }
from({ from(sourceSets.main.get().output)
configurations.runtimeClasspath.get() from({
.filter { it.name.endsWith(".jar") } configurations.runtimeClasspath
.map { zipTree(it) } .get()
}) { .filter { it.name.endsWith(".jar") }
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA") .map { zipTree(it) }
}) {
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
}
} }
}
// Stage the fat jar into the jpackage input dir. A dedicated Sync task keeps // Stage the fat jar into the jpackage input dir. A dedicated Sync task keeps
// the Exec task free of task references (configuration-cache compatible) and // the Exec task free of task references (configuration-cache compatible) and
@@ -76,23 +79,39 @@ tasks.register<Exec>("jpackage") {
val jpackageBin = file("${System.getProperty("java.home")}/bin/jpackage") val jpackageBin = file("${System.getProperty("java.home")}/bin/jpackage")
val type = (project.findProperty("jpackageType") as? String) ?: "app-image" val type = (project.findProperty("jpackageType") as? String) ?: "app-image"
val inputDir = jpackageInputDir.get().asFile val inputDir = jpackageInputDir.get().asFile
val destDir = layout.buildDirectory.dir("jpackage").get().asFile val destDir =
layout.buildDirectory
.dir("jpackage")
.get()
.asFile
inputs.dir(inputDir) inputs.dir(inputDir)
outputs.dir(destDir) outputs.dir(destDir)
commandLine( commandLine(
if (jpackageBin.exists()) jpackageBin.absolutePath else "jpackage", if (jpackageBin.exists()) jpackageBin.absolutePath else "jpackage",
"--name", "iris", "--name",
"--app-version", appVersion, "iris",
"--vendor", "Iris", "--app-version",
"--type", type, appVersion,
"--input", inputDir.absolutePath, "--vendor",
"--main-jar", "desktopApp-all.jar", "Iris",
"--main-class", "iris.desktop.MainKt", "--type",
"--icon", file("src/main/resources/icon.png").absolutePath, type,
"--dest", destDir.absolutePath, "--input",
"--java-options", "-Xmx1g", inputDir.absolutePath,
"--main-jar",
"desktopApp-all.jar",
"--main-class",
"iris.desktop.MainKt",
"--icon",
file("src/main/resources/icon.png").absolutePath,
"--dest",
destDir.absolutePath,
"--java-options",
"-Xmx1g",
// M9: KCEF (JCEF) AWT reflection access (see the JavaExec block above). // M9: KCEF (JCEF) AWT reflection access (see the JavaExec block above).
"--java-options", "--add-opens=java.desktop/sun.awt=ALL-UNNAMED", "--java-options",
"--java-options", "--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED", "--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
"--java-options",
"--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED",
) )
} }