-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release/1.0.0
- Loading branch information
Showing
5 changed files
with
1,679 additions
and
2,032 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Profiling after push | ||
|
||
# This runs when code is pushed to main or develop | ||
on: | ||
push: | ||
branches: [main, develop] | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/pyrealm_ci.yaml | ||
secrets: inherit | ||
|
||
profiling: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.2.2 | ||
|
||
- name: Install dependencies and add env vars | ||
run: | | ||
poetry install | ||
sudo apt-get install graphviz | ||
calculatedSha=$(git rev-parse --short ${{ github.sha }}) | ||
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | ||
- name: Run the profiling test suite, using time to get peak memory usage | ||
id: profiling | ||
run: poetry run /usr/bin/time -v pytest -m "profiling" --profile-svg | ||
|
||
# This step only runs if the profiling succeeds | ||
- name: Benchmark performance | ||
id: benchmarking | ||
if: ${{steps.profiling.outcome == 'success'}} | ||
run: poetry run python profiling/run_benchmarking.py prof/combined.prof profiling/profiling-database.csv profiling/benchmark-fails.csv ${{ env.COMMIT_SHORT_SHA }} --update-on-pass --plot-path profiling/performance-plot.png | ||
|
||
# This step copies over the updated call graph | ||
- name: Copy call graph | ||
id: update-call-graph | ||
if: always() && steps.benchmarking.outcome != 'skipped' | ||
run: cp prof/combined.svg profiling/call-graph.svg | ||
|
||
# Creates a PR to update the profiling stats if the benchmark passes or fails and | ||
# skips if the profiling step fails. | ||
- name: Create pull request | ||
id: cpr | ||
if: always() && steps.benchmarking.outcome != 'skipped' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: Updating profiling stats for ${{ env.COMMIT_SHORT_SHA }} | ||
title: Updating profiling stats for ${{ env.COMMIT_SHORT_SHA }} | ||
add-paths: profiling/* | ||
body: | | ||
Automatic update of profiling stats. | ||
- Profiling update for merge of ${{ env.COMMIT_SHORT_SHA }} into ${{ github.head_ref }} | ||
- Updated call graph, benchmark plot and profiling stats database. | ||
- Auto-generated by `pyrealm_profiling.yaml` workflow | ||
${{ steps.benchmarking.outcome != 'passed' && 'Benchmarking passed' || 'Benchmarking **failed**: review failures.' }} | ||
- name: Check outputs | ||
if: ${{ steps.cpr.outputs.pull-request-number }} | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
This file contains 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
This file contains 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
Oops, something went wrong.