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

Use Mamba Instead of Conda When Running Benchmarks #2455

Merged
merged 4 commits into from
Dec 11, 2023
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
24 changes: 18 additions & 6 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master

pull_request_target:
branches:
- '*'
- master

types:
- opened
- reopened
Expand Down Expand Up @@ -38,10 +40,10 @@ jobs:
- name: Checkout pull/${{ github.event.number }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.sha }}
fetch-depth: 0
if: github.event_name == 'pull_request_target'

- name: Restore Atom Data
uses: actions/cache/restore@v3
id: atom-data-restore
Expand All @@ -62,24 +64,34 @@ jobs:
with:
path: benchmarks/data/kurucz_cd23_chianti_H_He.h5
key: atom-data

- name: Setup Mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: benchmark
init-shell: >-
bash
create-args: >-
python
asv
mamba

- name: Install asv
run: pip install asv==0.5.*
run: pip install asv

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

- name: Run benchmarks for last 5 commits if not PR
if: github.event_name != 'pull_request_target'
continue-on-error: true
run: |
git log -n 5 --pretty=format:"%H" >> tag_commits.txt
asv run HASHFILE:tag_commits.txt | tee asv-output.log
if grep -q failed asv-output.log; then
echo "Some benchmarks have failed!"
exit 1
fi

- name: Generate Graphs and HTML
if: github.event_name != 'pull_request_target'
run: asv publish
Expand Down
2 changes: 1 addition & 1 deletion asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
],
"branches": ["master"],
"environment_type": "conda",
"environment_type": "mamba",
"show_commit_url": "https://github.com/tardis-sn/tardis/commit",
"conda_environment_file": "tardis_env3.yml",
"benchmark_dir": "benchmarks",
Expand Down
Loading