Skip to content

Commit

Permalink
ci: Report wheel sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jan 3, 2025
1 parent 58c1745 commit 92b0e81
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,50 @@ jobs:
working-directory: py-polars
run: maturin develop --release -- -C codegen-units=8 -C lto=thin -C target-cpu=native

- name: Set wheel size
run: |
WHEEL_SIZE=$(ls -l polars/polars*.so | awk '{ print $5 }')
echo "WHEEL_SIZE=$WHEEL_SIZE" >> $GITHUB_ENV
- name: Upload wheel sizes artifact (main only)
if: github.ref_name == 'main'
uses: actions/upload-artifact@v3
with:
name: wheel-size
path: |
echo "$GITHUB_RUN_ID $WHEEL_SIZE" > wheel_sizes.txt
wheel_sizes.txt
- name: Download main wheel size
uses: actions/download-artifact@v3
with:
name: wheel-size
continue-on-error: true

- name: Extract previous wheel size
id: load_previous_size
run: |
if [[ -f wheel_sizes.txt ]]; then
PREVIOUS_WHEEL_SIZE=$(tail -n 1 wheel_sizes.txt | awk '{ print $2 }')
echo "PREVIOUS_WHEEL_SIZE=$PREVIOUS_WHEEL_SIZE" >> $GITHUB_ENV
else
echo "PREVIOUS_WHEEL_SIZE=Unknown" >> $GITHUB_ENV
fi
- name: Comment wheel size
- uses: actions/github-script@v7
with:
script: |
const previousSize = process.env.PREVIOUS_WHEEL_SIZE || 'Unknown';
const currentSize = process.env.CURRENT_WHEEL_SIZE || 'Unknown';
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The previous wheel size was **${previousSize} bytes**.\nThe current wheel size after this PR is **${currentSize} bytes**.`
})
- name: Run benchmark tests
uses: CodSpeedHQ/action@v3
with:
Expand All @@ -87,4 +131,4 @@ jobs:
working-directory: py-polars
env:
POLARS_AUTO_NEW_STREAMING: 1
run: pytest -n auto --dist loadgroup -m "not may_fail_auto_streaming and not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only"
run: pytest -n auto --dist loadgroup -m "not may_fail_auto_streaming and not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only"

0 comments on commit 92b0e81

Please sign in to comment.