Rewrite the launcher in MoonBit (old code moves to legacy/) (#1)
Launcher / test (push) Successful in 1m20s
Launcher / apk (push) Successful in 37s

This commit was merged in pull request #1.
This commit is contained in:
nandi committed 2026-11-23 01:57:10 +00:00
1 parent 7d2bf5996f
commit 2fa7bd745b
150 files changed
+8319 -462

No files matched your search

+53 -13
View File
@@ -1,26 +1,66 @@
name: Launcher
# The MoonBit launcher at the repo root: tests (moon test, a browser e2e of the page), then
# on every push to main an APK (android/build.sh) published as a Gitea release, which the
# installed app updates itself from. The previous implementations live in legacy/ and have
# their own manual workflow (legacy.yml).
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
apk:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
container: eclipse-temurin:17-jdk-noble
# Node comes from the image, not actions/setup-node: its download stalls on this
# runner and holds the cluster's only runner slot (see identicons-web's workflow).
container:
image: node:22-bookworm
timeout-minutes: 20
steps:
- name: Checkout
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v4
- name: Install MoonBit
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends git ca-certificates >/dev/null
git init -q
git -c http.extraHeader="Authorization: Basic $(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 -w0)" \
fetch -q --depth 1 "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" "${GITHUB_SHA}"
git checkout -q --detach FETCH_HEAD
- name: Test, build and release the Qt APK
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
- name: Check and test
run: |
moon update
moon check --target js
moon test --target js
moon test --target wasm-gc
- name: Build the page and run the browser test
run: |
scripts/build-web.sh --demo
mkdir -p /tmp/e2e && cd /tmp/e2e && npm init -y >/dev/null
# Playwright's own Chromium download (cdn.playwright.dev) times out on this runner,
# so use Debian's chromium and point the tests at it.
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i --no-audit --no-fund playwright@1.65.1
apt-get update -qq && apt-get install -y -qq --no-install-recommends chromium >/dev/null
cd "$GITHUB_WORKSPACE"
export CHROMIUM_PATH=/usr/bin/chromium
export PLAYWRIGHT=/tmp/e2e/node_modules/playwright
node tests/e2e.cjs
node tests/android-sim.cjs
apk:
needs: test
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
# JDK 17 + Android SDK (platforms;android-35, build-tools 35.0.0, NDK) prebuilt by
# charts/android-sdk in nandi/cluster, so no per-run SDK download. Fallback until that image
# is built and pullable: use `node:22-bookworm` here; ci/gitea-apk.sh then installs the JDK
# and downloads the SDK pieces itself.
container:
image: git.site.latha.org/cluster-services/android-sdk:latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Build and release the APK
env:
GITEA_TOKEN: ${{ github.token }}
run: bash ci/gitea-apk.sh
+33
View File
@@ -0,0 +1,33 @@
name: Legacy launcher (Qt)
# The Qt build now lives in legacy/. The launcher is built from the repo root (MoonBit, see
# launcher.yml), so this runs only by hand, and does not publish a release unless asked: its
# releases (build-<minutes>) would otherwise compete with the MoonBit build's for "latest".
on:
workflow_dispatch:
inputs:
publish:
description: Publish the APK as a release
default: "false"
jobs:
apk:
runs-on: ubuntu-latest
timeout-minutes: 60
container: eclipse-temurin:17-jdk-noble
steps:
- name: Checkout
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends git ca-certificates >/dev/null
git init -q
git -c http.extraHeader="Authorization: Basic $(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 -w0)" \
fetch -q --depth 1 "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" "${GITHUB_SHA}"
git checkout -q --detach FETCH_HEAD
- name: Test, build and release the Qt APK
env:
GITEA_TOKEN: ${{ github.token }}
LEGACY_PUBLISH: ${{ inputs.publish }}
run: bash legacy/ci/gitea-apk.sh