feat: stabilize device connectivity and displays #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Report | |
| on: | |
| push: | |
| branches: [master] | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| report: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: gradle/actions/setup-gradle@v4 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Build creature-simulator demo | |
| run: pnpm run demo:build | |
| - name: Run Vitest with coverage | |
| id: vitest | |
| continue-on-error: true | |
| run: | | |
| mkdir -p coverage/test-report | |
| npx vitest run --reporter=json --reporter=default --outputFile=coverage/test-report/vitest.json --coverage | |
| env: | |
| COLORTERM: truecolor | |
| TZ: Asia/Seoul | |
| - name: Run Android tests | |
| id: android | |
| continue-on-error: true | |
| run: cd android && ./gradlew testDebugUnitTest | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.platformio/packages | |
| ~/.platformio/platforms | |
| esp32/.pio | |
| key: pio-${{ hashFiles('esp32/platformio.ini') }} | |
| restore-keys: pio- | |
| - name: Run Robot Framework tests (no-hw) | |
| id: robot | |
| continue-on-error: true | |
| env: | |
| PIO_TIMEOUT: 600 | |
| run: | | |
| pip install robotframework platformio pyserial pyyaml intelhex | |
| # Pre-build all envs to cache toolchains + frameworks | |
| cd esp32 | |
| pio run -e box_86 || true | |
| pio run -e ips_35 || true | |
| pio run -e round_amoled || true | |
| pio run -e ulanzi_tc001 || true | |
| pio run -e boot_test || true | |
| pio run -e boot_test_qspi || true | |
| cd .. | |
| mkdir -p coverage/test-report/robot | |
| cd esp32/robot && python3 -m robot --include no-hw --exclude hw --exclude local-only \ | |
| --outputdir ../../coverage/test-report/robot \ | |
| tests/ | |
| - name: Fetch previous history | |
| run: | | |
| PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${GITHUB_REPOSITORY#*/}" | |
| curl -sf "${PAGES_URL}/reports/history.json" -o coverage/test-report/history.json || echo '[]' > coverage/test-report/history.json | |
| continue-on-error: true | |
| - name: Generate HTML report | |
| if: always() | |
| run: | | |
| python3 - <<'PY' | |
| import json, os | |
| from pathlib import Path | |
| report_dir = Path("coverage/test-report") | |
| report_dir.mkdir(parents=True, exist_ok=True) | |
| def normalize(status): | |
| return {"success": "pass", "failure": "fail", "cancelled": "error"}.get(status, "not-run") | |
| def suite(status, executed, note): | |
| return {"status": normalize(status), "executed": executed, "note": note} | |
| data = { | |
| "run_profile": "github-pages", | |
| "suites": { | |
| "vitest": suite(os.environ["VITEST_OUTCOME"], True, "Coverage + JSON report"), | |
| "android": suite(os.environ["ANDROID_OUTCOME"], True, "JUnit + Robolectric on ubuntu"), | |
| "apple": suite("not-run", False, "Not executed in Pages workflow (requires macOS runner)"), | |
| "robot": suite(os.environ["ROBOT_OUTCOME"], True, "Robot Framework no-hw subset"), | |
| }, | |
| } | |
| (report_dir / "run-metadata.json").write_text(json.dumps(data, indent=2), encoding="utf-8") | |
| PY | |
| python3 scripts/generate-html-report.py | |
| env: | |
| VITEST_OUTCOME: ${{ steps.vitest.outcome }} | |
| ANDROID_OUTCOME: ${{ steps.android.outcome }} | |
| ROBOT_OUTCOME: ${{ steps.robot.outcome }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| - name: Assemble Pages site | |
| run: | | |
| mkdir -p _site/reports _site/demo | |
| # Landing page at root | |
| cp scripts/pages-index.html _site/index.html | |
| cp docs/media/agentdeck-icon.png _site/icon.png | |
| # Live demo under /demo/ | |
| cp -R dist/demo/. _site/demo/ | |
| # Test report under /reports/ | |
| cp coverage/test-report/index.html _site/reports/index.html | |
| cp coverage/test-report/history.json _site/reports/history.json 2>/dev/null || true | |
| cp coverage/test-report/summary.json _site/reports/summary.json 2>/dev/null || true | |
| cp coverage/test-report/run-metadata.json _site/reports/run-metadata.json 2>/dev/null || true | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| - name: Deploy to GitHub Pages | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |