chore(deps): bump actions/checkout from 4 to 7 #518
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: Package Size Check | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| package-size: | |
| name: Check Package Sizes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: 'pip' | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel build | |
| - name: Build all packages | |
| run: | | |
| for dir in Libraries/*/ Tools/*/; do | |
| if [ -f "$dir/pyproject.toml" ] || [ -f "$dir/setup.py" ]; then | |
| echo "Building $dir" | |
| cd "$dir" && python -m build 2>&1 | head -20 || echo "Build failed for $dir" | |
| cd - > /dev/null | |
| fi | |
| done | |
| - name: Check package sizes | |
| run: | | |
| echo "## Package Size Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Package | Size | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|---------|------|--------|" >> $GITHUB_STEP_SUMMARY | |
| for dist_file in Libraries/*/dist/*.whl Tools/*/dist/*.whl; do | |
| if [ -f "$dist_file" ]; then | |
| size=$(du -h "$dist_file" | cut -f1) | |
| size_bytes=$(stat -f%z "$dist_file" 2>/dev/null || stat -c%s "$dist_file" 2>/dev/null) | |
| size_mb=$(echo "scale=2; $size_bytes / 1024 / 1024" | bc) | |
| if (( $(echo "$size_mb > 50" | bc -l) )); then | |
| status="⚠️ Large" | |
| elif (( $(echo "$size_mb > 100" | bc -l) )); then | |
| status="❌ Very Large" | |
| else | |
| status="✓ OK" | |
| fi | |
| pkg_name=$(basename "$dist_file") | |
| echo "| $pkg_name | $size ($size_mb MB) | $status |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done |