Add GitHub workflow to run tests for changes under loop/webui/... (#7)
* Add GitHub workflow for loop/webui tests
This workflow runs npm test in the loop/webui directory
when there are changes to files in that directory.
Co-Authored-By: sketch
* webui: use terser output on ci
diff --git a/.github/workflows/webui_test.yml b/.github/workflows/webui_test.yml
new file mode 100644
index 0000000..86fbcc5
--- /dev/null
+++ b/.github/workflows/webui_test.yml
@@ -0,0 +1,44 @@
+name: WebUI Tests
+on:
+ workflow_call:
+ push:
+ branches-ignore:
+ - "queue-main-**"
+ paths:
+ - 'loop/webui/**'
+ pull_request:
+ paths:
+ - 'loop/webui/**'
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: 'npm'
+ cache-dependency-path: loop/webui/package-lock.json
+
+ - name: Install dependencies
+ working-directory: ./loop/webui
+ run: npm ci
+
+ - name: Install Playwright browsers
+ working-directory: ./loop/webui
+ run: npx playwright install --with-deps
+
+ - name: Run tests
+ working-directory: ./loop/webui
+ run: npm run test
+
+ - name: Upload test results
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: playwright-report
+ path: loop/webui/playwright-report/
+ retention-days: 7