From fd91e8fbcd32e88b914f53efec232b79e8d52a43 Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Fri, 3 Apr 2026 18:04:41 -0700 Subject: [PATCH] Use dedicated Android CI runner --- .gitea/workflows/ci.yml | 52 +++++++++++++++++++++++++++++++++++------ main_test.go | 2 ++ 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 175466c..a35096c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,15 +13,15 @@ permissions: contents: write env: - GO_VERSION: "1.26.0" + GO_VERSION: "1.26.1" ANDROID_SDK_ROOT: /opt/android-sdk - ANDROID_NDK_ROOT: /opt/android-ndk - JAVA_HOME: /usr/lib/jvm/java-25-openjdk + ANDROID_NDK_ROOT: /opt/android-sdk/ndk + JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64 DIST_DIR: dist jobs: lint-test: - runs-on: ubuntu-22.04 + runs-on: keepassgo-android steps: - name: Checkout uses: actions/checkout@v4 @@ -31,13 +31,32 @@ jobs: with: go-version: ${{ env.GO_VERSION }} + - name: Install native build dependencies + shell: bash + run: | + set -euo pipefail + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends \ + zsh \ + pkg-config \ + libx11-dev \ + libx11-xcb-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libwayland-dev \ + libvulkan-dev \ + libegl1-mesa-dev \ + libxcursor-dev \ + libxfixes-dev + - name: Lint shell: bash run: | set -euo pipefail state_dir="$(mktemp -d)" trap 'rm -rf -- "$state_dir"' EXIT - KEEPASSGO_STATE_DIR="$state_dir" go tool golangci-lint run + KEEPASSGO_STATE_DIR="$state_dir" go tool golangci-lint run --build-tags nox11,nowayland,novulkan ./... - name: Test shell: bash @@ -45,11 +64,11 @@ jobs: set -euo pipefail state_dir="$(mktemp -d)" trap 'rm -rf -- "$state_dir"' EXIT - KEEPASSGO_STATE_DIR="$state_dir" go test ./... + KEEPASSGO_STATE_DIR="$state_dir" go test -tags nox11,nowayland,novulkan ./... build: needs: lint-test - runs-on: ubuntu-22.04 + runs-on: keepassgo-android steps: - name: Checkout uses: actions/checkout@v4 @@ -59,6 +78,25 @@ jobs: with: go-version: ${{ env.GO_VERSION }} + - name: Install native build dependencies + shell: bash + run: | + set -euo pipefail + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends \ + zsh \ + pkg-config \ + libx11-dev \ + libx11-xcb-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libwayland-dev \ + libvulkan-dev \ + libegl1-mesa-dev \ + libxcursor-dev \ + libxfixes-dev + - name: Prepare dist directory shell: bash run: | diff --git a/main_test.go b/main_test.go index 0232c3a..ad4a3eb 100644 --- a/main_test.go +++ b/main_test.go @@ -2802,6 +2802,7 @@ func TestUIKeyboardShortcutActionsDispatchExpectedCommands(t *testing.T) { }, }, }) + u.clipboardWriter = &memoryClipboardWriter{} u.showEntriesSection() u.state.NavigateToPath([]string{"Root", "Internet"}) u.filter() @@ -3016,6 +3017,7 @@ func TestUIActionErrorsAndStatusMessagesAreCapturedForDisplay(t *testing.T) { {ID: "git-server", Title: "Git Server", Username: "joejulian", Password: "token-1", URL: "https://git.julianfamily.org", Path: []string{"Root", "Internet"}}, }, }) + u.clipboardWriter = &memoryClipboardWriter{} u.showEntriesSection() u.state.NavigateToPath([]string{"Root", "Internet"}) u.filter()