Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include ASV website #5

Merged
merged 33 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 78 additions & 5 deletions .github/workflows/asv_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Run ASV
on:
pull_request:
branches:
- main
schedule:
- cron: "20 * * * *"

Expand All @@ -12,20 +15,63 @@ permissions:
contents: read

jobs:
check-new-commit:
name: Check Latest Commit
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
outputs:
new_commit: ${{ steps.new-commit.outputs.new_commit }}
steps:
- name: Checkout pandas
uses: actions/checkout@v4
with:
repository: pandas-dev/pandas

- name: Checkout asv-runner results branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: asv-runner/

- name: Compare Commit SHAs
id: new-commit
run: |
echo "HEAD sha: $(git rev-parse HEAD)"
echo "Latest sha: $(cat asv-runner/data/latest_sha.txt)"
if [ "$(git rev-parse HEAD)" = "$(cat asv-runner/data/latest_sha.txt)" ]; then
echo "new_commit=no" >> "$GITHUB_OUTPUT"
else
echo "new_commit=yes" >> "$GITHUB_OUTPUT"
fi

produce-asv-benchmarks:
needs: check-new-commit
if: ${{ needs.check-new-commit.outputs.new_commit == 'yes' }}
name: ASV Benchmarks
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}

steps:
- name: Checkout
- name: Checkout pandas
uses: actions/checkout@v4
with:
repository: pandas-dev/pandas
fetch-depth: 0

- name: Checkout asv-runner results branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: asv-runner/

- name: Move html directory
run: |
mv asv-runner/docs/ asv_bench/html

- name: Set up Conda
uses: ./.github/actions/setup-conda

Expand All @@ -37,8 +83,10 @@ jobs:
cd asv_bench
asv machine --machine=asvrunner --yes
asv run --machine=asvrunner --python=same --set-commit-hash=$(git rev-parse HEAD) -b ^groupby.GroupByCythonAgg
asv publish
# Move to a standard location
mv results/asvrunner/$(git rev-parse --short=8 HEAD)*.json results.json
git rev-parse HEAD > latest_sha.txt

- name: Save JSON results as an artifact
uses: actions/upload-artifact@v4
Expand All @@ -47,9 +95,22 @@ jobs:
path: asv_bench/results.json
retention-days: 14

- name: Save html directory as an artifact
uses: actions/upload-artifact@v4
with:
name: html
path: asv_bench/html/

- name: Save latest_sha.txt as an artifact
uses: actions/upload-artifact@v4
with:
name: latest_sha.txt
path: asv_bench/latest_sha.txt

process-asv-benchmarks:
name: Process ASV Benchmarks
needs: produce-asv-benchmarks
needs: [check-new-commit, produce-asv-benchmarks]
if: ${{ needs.check-new-commit.outputs.new_commit == 'yes' }}
runs-on: ubuntu-24.04
defaults:
run:
Expand All @@ -74,15 +135,27 @@ jobs:
- name: Install dependencies
run: pip install pandas pyarrow

- name: Download JSON results
- name: Download results.json
uses: actions/download-artifact@v4
with:
name: results.json

- name: Download html
uses: actions/download-artifact@v4
with:
name: html
path: docs/

- name: Download latest_sha.txt
uses: actions/download-artifact@v4
with:
name: latest_sha.txt
path: data/

- name: Process ASV results
run: |
python ci/process_results.py

- name: Save parquet results as an artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -95,4 +168,4 @@ jobs:
with:
commit_message: Results
branch: ${{ env.BRANCH_NAME }}
file_pattern: data/results.parquet
file_pattern: 'data/ docs/'
Empty file added docs/.gitignore
Empty file.