Fix Mac Crash on Invoke Claude Button (#1185) #2
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
| # Cross-Platform CI Pipeline | |
| # | |
| # Tests on all target platforms (Linux, Windows, macOS) to catch | |
| # platform-specific bugs before they merge. ALL platforms must pass. | |
| # | |
| # Why this matters: Platform-specific code often breaks when developers | |
| # commit from one OS without testing on others. This CI prevents that. | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| # -------------------------------------------------------------------------- | |
| # Python Backend Tests - All Platforms | |
| # -------------------------------------------------------------------------- | |
| test-python: | |
| name: test-python (${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false # Don't cancel all jobs if one platform fails | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ['3.12', '3.13'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv package manager | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| working-directory: apps/backend | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv pip install -r requirements.txt | |
| uv pip install -r ../../tests/requirements-test.txt | |
| - name: Run tests | |
| working-directory: apps/backend | |
| shell: bash | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/apps/backend | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| pytest ../../tests/ -v --tb=short -x | |
| - name: Run coverage (Python 3.12 only) | |
| if: matrix.python-version == '3.12' | |
| working-directory: apps/backend | |
| shell: bash | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/apps/backend | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| pytest ../../tests/ -v --cov=. --cov-report=xml --cov-report=term-missing --cov-fail-under=10 | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.12' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./apps/backend/coverage.xml | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| # -------------------------------------------------------------------------- | |
| # Frontend Tests - All Platforms | |
| # -------------------------------------------------------------------------- | |
| test-frontend: | |
| name: test-frontend (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Get npm cache directory | |
| id: npm-cache | |
| shell: bash | |
| run: echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT" | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.npm-cache.outputs.dir }} | |
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-npm- | |
| - name: Install dependencies | |
| working-directory: apps/frontend | |
| run: npm ci --ignore-scripts | |
| - name: Run TypeScript type check | |
| working-directory: apps/frontend | |
| run: npm run typecheck | |
| - name: Run unit tests | |
| working-directory: apps/frontend | |
| run: npm run test | |
| - name: Build application | |
| working-directory: apps/frontend | |
| run: npm run build | |
| # -------------------------------------------------------------------------- | |
| # Platform-Specific Integration Tests | |
| # -------------------------------------------------------------------------- | |
| test-platform-integration: | |
| name: test-integration (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| # Only run integration tests after basic tests pass | |
| needs: [test-python, test-frontend] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Install backend dependencies | |
| working-directory: apps/backend | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv pip install -r requirements.txt | |
| uv pip install -r ../../tests/requirements-test.txt | |
| - name: Run platform-specific tests | |
| working-directory: apps/backend | |
| shell: bash | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/apps/backend | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| pytest ../../tests/test_platform.py -v --tb=short | |
| # -------------------------------------------------------------------------- | |
| # Gate Job - Single check for branch protection | |
| # -------------------------------------------------------------------------- | |
| ci-complete: | |
| name: CI Complete | |
| runs-on: ubuntu-latest | |
| needs: [test-python, test-frontend, test-platform-integration] | |
| if: always() | |
| steps: | |
| - name: Check all CI jobs passed | |
| run: | | |
| echo "CI Job Results:" | |
| echo " test-python: ${{ needs.test-python.result }}" | |
| echo " test-frontend: ${{ needs.test-frontend.result }}" | |
| echo " test-platform-integration: ${{ needs.test-platform-integration.result }}" | |
| echo "" | |
| if [[ "${{ needs.test-python.result }}" != "success" ]] || \ | |
| [[ "${{ needs.test-frontend.result }}" != "success" ]] || \ | |
| [[ "${{ needs.test-platform-integration.result }}" != "success" ]]; then | |
| echo "❌ One or more CI jobs failed" | |
| exit 1 | |
| fi | |
| echo "✅ All CI checks passed" |