From 9b44523497eb023d272f25431034005599f72865 Mon Sep 17 00:00:00 2001 From: Hamza Merzic Date: Mon, 13 Jul 2026 17:35:12 +0000 Subject: [PATCH] ci: run app tests + package verify on push/PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Möbius mini-app CI: checks out the public mobius-os/mobius frontend once and points MOBIUS_FRONTEND_NODE_MODULES at it (mini-app tests bundle index.jsx and import react/marked/dompurify). Runs npm test + verify:mobius if present. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..db7af0b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +# Validates the app on every push to main and every PR. Möbius mini-app tests +# bundle index.jsx with esbuild and import the shell's frontend deps (react, +# marked, dompurify, …), so CI checks out mobius-os/mobius (public) and installs +# its frontend once, then points MOBIUS_FRONTEND_NODE_MODULES at it. +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout app + uses: actions/checkout@v4 + + - name: Checkout mobius frontend (test dependencies) + uses: actions/checkout@v4 + with: + repository: mobius-os/mobius + path: .mobius + sparse-checkout: frontend + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: .mobius/frontend/package-lock.json + + - name: Install mobius frontend deps + run: cd .mobius/frontend && npm ci + + - name: Install app deps (if declared) + run: | + if [ -f package-lock.json ]; then npm ci + else npm install --no-audit --no-fund + fi + + - name: Test + env: + MOBIUS_FRONTEND_NODE_MODULES: ${{ github.workspace }}/.mobius/frontend/node_modules + run: npm test --if-present + + - name: Verify mobius package + run: npm run verify:mobius --if-present