Files
launcher/.gitea/workflows/launcher.yml
nandi 2fa7bd745b
Launcher / test (push) Successful in 1m20s
Launcher / apk (push) Successful in 37s
Rewrite the launcher in MoonBit (old code moves to legacy/) (#1)
2026-11-23 01:57:10 +00:00

67 lines
2.4 KiB
YAML

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:
test:
runs-on: ubuntu-latest
# 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:
- uses: actions/checkout@v4
- name: Install MoonBit
run: |
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