fix(ui): make dashboard stat cards responsive and height-stable #666
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: Tests | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| paths: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'requirements*.txt' | |
| - 'requirements*.in' | |
| - 'pytest.ini' | |
| - 'ruff.toml' | |
| - '.github/workflows/test.yml' | |
| pull_request: | |
| branches: ["**"] | |
| paths: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'requirements*.txt' | |
| - 'requirements*.in' | |
| - 'pytest.ini' | |
| - 'ruff.toml' | |
| - '.github/workflows/test.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Lint & static analysis | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Install lint tools | |
| run: pip install ruff | |
| - name: ruff check (linting) | |
| run: ruff check src/ tests/ | |
| - name: ruff format (style check) | |
| run: ruff format --check src/ tests/ | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Test matrix | |
| # - main / master branch or any pull_request → all three platforms | |
| # - all other pushes → ubuntu only | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| test: | |
| name: Tests (${{ matrix.os }}) | |
| needs: lint | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event_name == 'pull_request') && fromJSON('["ubuntu-latest","windows-latest","macos-latest"]') || fromJSON('["ubuntu-latest"]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Install runtime and test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-test.in | |
| shell: bash | |
| - name: Run tests with coverage | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: | | |
| pytest \ | |
| --cov=src \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml:coverage.xml \ | |
| -q | |
| shell: bash | |
| - name: Upload coverage report | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.xml | |
| retention-days: 14 | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Summary gate – required status check for branch protection rules | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| all-tests-pass: | |
| name: All tests passed | |
| needs: [lint, test] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| declare -A results=( | |
| [lint]="${{ needs.lint.result }}" | |
| [test]="${{ needs.test.result }}" | |
| ) | |
| failed=0 | |
| for job in "${!results[@]}"; do | |
| if [[ "${results[$job]}" == "failure" ]]; then | |
| echo "::error::Job '${job}' failed (result: ${results[$job]})." | |
| failed=1 | |
| fi | |
| done | |
| if [[ $failed -ne 0 ]]; then exit 1; fi | |
| echo "All checks passed." |