Skip to content

Commit

Permalink
Testing asish PR
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Jul 1, 2024
1 parent 2e5232a commit 74d8a19
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ defaults:

jobs:
build:
if: github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'benchmarks'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -80,6 +84,9 @@ jobs:
- name: Install asv
run: pip install asv

- run: git remote add upstream https://github.com/tardis-sn/tardis
- run: git fetch upstream master

- name: Accept all asv questions
run: asv machine --yes

Expand Down Expand Up @@ -119,9 +126,6 @@ jobs:
if: github.event_name == 'pull_request_target'
run: asv run --config asv.conf.json

- run: git remote add upstream https://github.com/KasukabeDefenceForce/tardis.git
- run: git fetch upstream master

- name: Compare Master and PR head
run: asv compare upstream/master HEAD --config asv.conf.json | tee asv-compare-output.log

Expand All @@ -143,24 +147,27 @@ jobs:
- name: Run benchmarks for base to head commits of PR
if: github.event_name == 'pull_request_target'
run: |
mkdir -p PR-${{ github.event.number }}
cd PR-${{ github.event.number }}
asv machine --yes
asv run ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | tee asv-output-PR.log
if grep -q failed asv-output-PR.log; then
echo "Some benchmarks have failed!"
exit 1
fi
echo $(git rev-parse HEAD) > commit_hashes.txt
echo $(git merge-base HEAD upstream/master) >> commit_hashes.txt
asv run HASHFILE:commit_hashes.txt | tee asv-output-PR.log
if grep -q failed asv-output-PR.log; then
echo "Some benchmarks have failed!"
exit 1
fi
- name: Generate Graphs and HTML of PR
if: github.event_name == 'pull_request_target'
run: |
cd PR-${{ github.event.number }}
asv publish
- name: Delete env files of PR
if: github.event_name == 'pull_request_target'
run: rm -r PR-${{ github.event.number }}/.asv/env
run: rm -r .asv/env

- name: Move .asv to PR folder
if: github.event_name == 'pull_request_target'
run: mv .asv PR-${{ github.event.number }}

- name: Push results of PR to results repository
if: github.event_name == 'pull_request_target'
Expand Down Expand Up @@ -216,8 +223,11 @@ jobs:
```
</details>
If you want to see the graph of the results, you can check it [**here**](${{ env.URL_PAGES }})
env:
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true
URL_PAGES: https://tardis-sn.github.io/tardis-benchmarks/PR-${{ github.event.number }}

- name: Save results artifact
uses: actions/upload-artifact@v4
Expand Down
15 changes: 11 additions & 4 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@
"project": "tardis",
"project_url": "https://tardis-sn.github.io/tardis",
"repo": ".",
"install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
"uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
"install_command": [
"in-dir={env_dir} python -mpip install {wheel_file}"
],
"uninstall_command": [
"return-code=any python -mpip uninstall -y {project}"
],
"build_command": [
"python setup.py build",
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
],
"branches": ["master"],
"branches": [
"upstream/master",
"HEAD"
],
"environment_type": "mamba",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit/",
"conda_environment_file": "tardis_env3.yml",
"benchmark_dir": "benchmarks",
"env_dir": ".asv/env",
"results_dir": ".asv/results",
"html_dir": ".asv/html"
}
}

0 comments on commit 74d8a19

Please sign in to comment.