Add automatic npm Claude removal after native installation #246
Workflow file for this run
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: Test & Coverage | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| test: | |
| name: Test Python on ${{ matrix.os }} | |
| if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: pyproject.toml | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync --all-extras --dev | |
| - name: Run pytest with coverage | |
| run: uv run pytest -v --cov=scripts --cov-report=term-missing --cov-report=xml --cov-report=html --junit-xml=test-results.xml tests/ | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: test-results.xml | |
| - name: Upload coverage reports | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| coverage.xml | |
| htmlcov/ | |
| - name: Surface test results | |
| if: always() | |
| uses: pmeier/pytest-results-action@main | |
| with: | |
| path: test-results.xml | |
| summary: true | |
| display-options: fEX | |
| fail-on-empty: true | |
| - name: Coverage comment | |
| if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' | |
| uses: py-cov-action/python-coverage-comment-action@v3 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| MINIMUM_GREEN: 80 | |
| MINIMUM_ORANGE: 60 | |
| test-install-scripts: | |
| name: Test Install Scripts | |
| if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: pyproject.toml | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Test setup_environment.py imports | |
| run: | | |
| uv run python -c "import sys; sys.path.insert(0, 'scripts'); import setup_environment" | |
| - name: Test install_claude.py imports | |
| run: | | |
| uv run python -c "import sys; sys.path.insert(0, 'scripts'); import install_claude" | |
| - name: Test setup with dry run (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| uv run python scripts/setup_environment.py python --skip-install || true | |
| - name: Test setup with dry run (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| uv run python scripts/setup_environment.py python --skip-install | |
| continue-on-error: true | |
| # Summary job | |
| summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [test, test-install-scripts] | |
| if: ${{ always() && ! startsWith(github.head_ref, 'release-please--branches--') }} | |
| steps: | |
| - name: Summary | |
| run: | | |
| echo "## Test Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "✅ All tests completed successfully!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Test Matrix" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Ubuntu + Python" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Windows + Python" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ macOS + Python" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Validation Tests" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Install scripts tested" >> $GITHUB_STEP_SUMMARY |