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
17 changes: 13 additions & 4 deletions .github/workflows/build-browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:
workflow_dispatch:
push:
paths:
- "index.html"
- "main.js"
- "os/main.c"
- "os/wasm-rtos"
- ".gitmodules"
- "build-browser.sh"
- ".github/workflows/build-browser.yml"
pull_request:
paths:
- "index.html"
- "main.js"
- "os/main.c"
- "os/wasm-rtos"
- ".gitmodules"
Expand Down Expand Up @@ -48,6 +52,11 @@ jobs:
echo "::warning::The nested wasm3 checkout is newer than the gitlink recorded by wasm-rtos. It is used by this build, but must be committed in the wasm-rtos repository to become permanent."
fi

- name: Validate site JavaScript
run: |
node --check main.js
grep -q 'os/wasm-rtos.js' index.html

- name: Install latest Emscripten SDK
run: |
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$RUNNER_TEMP/emsdk" >/dev/null
Expand Down Expand Up @@ -82,21 +91,21 @@ jobs:
grep -q "createWasmRtosModule" os/wasm-rtos.js
ls -lh os/wasm-rtos.js os/wasm-rtos.wasm

- name: Persist updated wasm-rtos submodule
- name: Publish runtime files to the site branch
if: github.event_name == 'push'
run: |
branch="${{ github.ref_name }}"

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add os/wasm-rtos
git add os/wasm-rtos os/wasm-rtos.js os/wasm-rtos.wasm

if git diff --cached --quiet; then
echo "No wasm-rtos submodule pointer changed"
echo "No browser runtime or submodule pointer changed"
exit 0
fi

git commit -m "Update wasm-rtos submodule"
git commit -m "Update browser runtime"
git push origin "HEAD:$branch"

- name: Upload browser runtime
Expand Down
17 changes: 9 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>wasm-rtos</title>
<link rel="stylesheet" href="style.css">
<script src="os/wasm-rtos.js" defer></script>
<script src="main.js" defer></script>
</head>
<body>
Expand Down Expand Up @@ -44,7 +45,7 @@ <h2 id="upload-title">Drag &amp; Drop WASM App</h2>
<div class="card-header">
<div class="title-group">
<h2 id="tasks-title">Tasks</h2>
<span id="activeBadge" class="pill">6 Active</span>
<span id="activeBadge" class="pill">0 Tasks</span>
</div>
<button id="newTaskButton" class="secondary-button" type="button">+ New Task</button>
</div>
Expand Down Expand Up @@ -77,7 +78,7 @@ <h2 id="console-title">Console</h2>
<section class="card preview-card" aria-labelledby="preview-title">
<div class="card-header">
<h2 id="preview-title">Preview Output</h2>
<span class="app-label">app: orbit.wasm <span aria-hidden="true">●</span></span>
<span class="app-label">wasm-rtos <span aria-hidden="true">●</span></span>
</div>
<div class="canvas-shell">
<canvas id="previewCanvas" aria-label="Animated WebAssembly preview output"></canvas>
Expand All @@ -87,12 +88,12 @@ <h2 id="preview-title">Preview Output</h2>
</div>

<section class="card stats-bar" aria-label="Runtime statistics">
<div class="stat cpu-stat"><div class="cpu-meter"><span>CPU</span><strong>18%</strong><div class="progress"><i style="width:18%"></i></div></div></div>
<div class="stat"><span>MEMORY</span><strong>412 MB <em>/ 2 GB</em></strong><div class="progress"><i style="width:22%"></i></div></div>
<div class="stat"><span>ACTIVE TASKS</span><strong><b id="activeRatio">3 / 6</b></strong><div class="progress"><i id="activeProgress" style="width:50%"></i></div></div>
<div class="stat"><span>RUNTIME</span><strong id="runtimeClock">01:24:37</strong></div>
<div class="stat"><span>QUEUE</span><strong id="queueCount">2</strong><div class="progress"><i id="queueProgress" style="width:34%"></i></div></div>
<div class="runtime-ok"><span class="status-dot"></span><div><strong>Runtime: OK</strong><small>All systems nominal</small></div></div>
<div class="stat cpu-stat"><div class="cpu-meter"><span>CPU</span><strong id="cpuValue">0%</strong><div class="progress"><i id="cpuProgress" style="width:0%"></i></div></div></div>
<div class="stat"><span>MEMORY</span><strong id="memoryValue">0 MB</strong><div class="progress"><i id="memoryProgress" style="width:0%"></i></div></div>
<div class="stat"><span>ACTIVE TASKS</span><strong><b id="activeRatio">0 / 0</b></strong><div class="progress"><i id="activeProgress" style="width:0%"></i></div></div>
<div class="stat"><span>RUNTIME</span><strong id="runtimeClock">00:00:00</strong></div>
<div class="stat"><span>QUEUE</span><strong id="queueCount">0</strong><div class="progress"><i id="queueProgress" style="width:0%"></i></div></div>
<div class="runtime-ok"><span class="status-dot"></span><div><strong id="runtimeStatus">Runtime: Loading</strong><small id="runtimeStatusDetail">Initializing wasm-rtos</small></div></div>
</section>
</main>
</body>
Expand Down
Loading
Loading