Merge pull request #652 from Codename-11/dev #116
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: CI dashboard plugin | |
| on: | |
| workflow_call: | |
| push: | |
| branches: [main, dev] | |
| paths: | |
| - "plugin/dashboard/**" | |
| - ".github/workflows/ci-dashboard.yml" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-dashboard-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} | |
| jobs: | |
| build-and-test: | |
| name: Build and test dashboard plugin | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| cache-dependency-path: plugin/dashboard/package-lock.json | |
| - name: Install dashboard deps | |
| working-directory: plugin/dashboard | |
| run: npm ci | |
| - name: Build dashboard bundle | |
| working-directory: plugin/dashboard | |
| run: npm run build | |
| - name: Test dashboard source | |
| working-directory: plugin/dashboard | |
| run: npm test | |
| - name: Setup Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Verify plugin-owned version metadata | |
| run: python scripts/check-plugin-version-sync.py | |
| - name: Install dashboard API test deps | |
| # The suite imports the `plugin` package transitively: __init__ loads | |
| # android_tool/desktop_tool (`import requests`), and one test imports | |
| # `plugin.relay`, whose server.py needs `aiohttp` (+ pyyaml) from | |
| # relay_server/requirements.txt. fastapi+httpx cover plugin_api itself. | |
| run: pip install -r relay_server/requirements.txt fastapi httpx requests | |
| - name: Run dashboard API tests | |
| run: >- | |
| python -m unittest | |
| plugin.dashboard.test_plugin_api | |
| plugin.dashboard.test_git_api | |
| plugin.dashboard.test_mobile_plugin_api | |
| - name: Verify dashboard bundle outputs | |
| run: | | |
| test -s plugin/dashboard/dist/index.js | |
| test -s plugin/dashboard/dist/style.css | |
| grep -q "hr-modal-card" plugin/dashboard/dist/style.css |