Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI

# Push only. A push to a branch that has an open pull request raises both the
# `push` and the `pull_request` event, so listening to both ran every check
# twice for one commit. Fork pull requests are not tested by this workflow;
# their commits are not pushed here.
# Pull requests to protected master are already checked on dev. The merge
# commit starts Release when the version changes, so it does not need CI again.
on:
push:
branches: [master, dev]
branches: [dev]
workflow_dispatch:

permissions:
Expand All @@ -20,6 +18,10 @@ jobs:
native-tests:
name: C++23 / GoogleTest
runs-on: ubuntu-latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_MAXSIZE: 500M
# Ubuntu 24.04 ships GCC 13 and the toolchain PPA only offers a March 2026
# GCC 16 snapshot; both mis-compile this codebase (a spurious
# -Wfree-nonheap-object, then an internal compiler error in gimplify). The
Expand All @@ -38,7 +40,7 @@ jobs:
set -euo pipefail
apt-get update
apt-get install --yes --no-install-recommends \
ninja-build libgtest-dev libsqlite3-dev libssl-dev zlib1g-dev \
ninja-build ccache libgtest-dev libsqlite3-dev libssl-dev zlib1g-dev \
libcurl4-openssl-dev cmake curl git ca-certificates \
libgtk-4-1 libgraphene-1.0-0 libepoxy0 libsoup-3.0-0 \
libgstreamer-plugins-base1.0-0
Expand All @@ -48,6 +50,17 @@ jobs:
g++ --version | head -1
cmake --version | head -1

- name: Restore C++ compilation cache
uses: actions/cache@v4
with:
path: .ccache
key: ccache-gcc16.2-${{ runner.os }}-${{ github.sha }}
restore-keys: |
ccache-gcc16.2-${{ runner.os }}-

- name: Reset C++ cache statistics
run: ccache --zero-stats

- name: Install HuxerUI SDK 0.3.0
timeout-minutes: 10
run: |
Expand All @@ -68,14 +81,19 @@ jobs:
cp -a "$HOME/.local/share/HuxerUI" "$HUXERUI_HOME"
fi
cmake -S tests -B build/tests-ninja -G Ninja \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Build tests
timeout-minutes: 30
env:
HUXERUI_HOME: ${{ github.workspace }}/.huxerui-sdk
run: cmake --build build/tests-ninja --parallel 8

- name: Report C++ cache statistics
run: ccache --show-stats

- name: Run GoogleTest suite
timeout-minutes: 15
run: ctest --test-dir build/tests-ninja --output-on-failure -j8
Expand All @@ -99,6 +117,10 @@ jobs:

- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
# dev is not the default branch, so setup-gradle otherwise reads
# caches without writing the updated dependency/build cache back.
cache-read-only: false

- name: Install Android build dependencies
run: |
Expand All @@ -115,20 +137,15 @@ jobs:
- name: Generate HuxerUI Android library graph
env:
HUXERUI_HOME: /home/runner/.local/share/HuxerUI
CMAKE_BUILD_PARALLEL_LEVEL: 8
# `--source` names a HuxerUI *source checkout*, not this project, so
# passing the repository root made the CLI reject it as an invalid
# checkout. Run from the project root and let it default to the
# working directory.
run: /home/runner/.local/share/HuxerUI/bin/huxerui build android --profile debug
run: bash tools/generate_android_library_graph.sh

- name: Make Gradle wrapper executable
run: chmod +x platform/android/gradlew

- name: Lint and build debug APK
env:
HUXERUI_HOME: /home/runner/.local/share/HuxerUI
run: ./platform/android/gradlew -p platform/android :app:lintDebug :app:assembleDebug --max-workers=8 --console=plain
run: ./platform/android/gradlew -p platform/android :app:lintDebug :app:assembleDebug --build-cache --max-workers=8 --console=plain

- name: Upload debug APK
uses: actions/upload-artifact@v4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:

- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false

# The SDK manager sometimes stalls on one download; bound the step so a
# slow mirror fails on its own instead of consuming the job's budget.
Expand Down Expand Up @@ -61,8 +63,7 @@ jobs:
timeout-minutes: 30
env:
HUXERUI_HOME: /home/runner/.local/share/HuxerUI
CMAKE_BUILD_PARALLEL_LEVEL: 8
run: /home/runner/.local/share/HuxerUI/bin/huxerui build android --profile debug
run: bash tools/generate_android_library_graph.sh

- name: Validate signing secrets
env:
Expand Down Expand Up @@ -116,7 +117,7 @@ jobs:
chmod +x platform/android/gradlew
./platform/android/gradlew -p platform/android \
:app:validateReleaseSigning :app:assembleRelease \
--max-workers=8 --console=plain
--build-cache --max-workers=8 --console=plain

- name: Prepare release artifacts
env:
Expand Down
17 changes: 17 additions & 0 deletions tools/generate_android_library_graph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

: "${HUXERUI_HOME:?HUXERUI_HOME must point to the installed SDK}"
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
graph_file="$project_root/.huxerui/generated/libraries.json"

# The HuxerUI CLI also assembles a Debug APK. Gradle builds the requested
# variant later; this configure-only mode supplies its library graph.
mkdir -p "$(dirname "$graph_file")"
cmake -S "$project_root" \
-B "$project_root/.huxerui/build/library-graph" \
-G Ninja \
-DHUXERUI_LIBRARY_GRAPH_ONLY=ON \
-DHUXERUI_LIBRARY_GRAPH_OUTPUT="$graph_file" \
-DHUXERUI_HOME="$HUXERUI_HOME"
test -s "$graph_file"
Loading