Restore sidebar share and embed snippets, and fix query parameter reg… #2316
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: Unit Tests | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| id: setup-python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Cache uv packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/uv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Install system dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update -qy | |
| sudo apt-get install -qy ffmpeg | |
| - name: Install system dependencies (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| # FFmpeg installation for Windows (using chocolatey) | |
| choco install ffmpeg -y | |
| - name: Install Python dependencies | |
| run: | | |
| uv pip install --system -e '.[dev,tensorboard,spaces]' --prerelease=allow --python "${{ steps.setup-python.outputs.python-path }}" | |
| uv pip install --system pytest --prerelease=allow --python "${{ steps.setup-python.outputs.python-path }}" | |
| - name: Set up Node.js | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build frontend | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| cd trackio/frontend | |
| npm ci | |
| npm run build | |
| - name: Run frontend unit tests | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| cd trackio/frontend | |
| npm test | |
| - name: Install Playwright | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| "${{ steps.setup-python.outputs.python-path }}" -m playwright install chromium | |
| - name: Run backend unit tests | |
| run: | | |
| "${{ steps.setup-python.outputs.python-path }}" -m pytest --deselect=tests/ui --deselect=tests/e2e-spaces | |
| - name: Run ui/ux interaction tests | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| "${{ steps.setup-python.outputs.python-path }}" -m pytest tests/ui | |