Create github actions for running benchmark #22
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
name: Run Benchmark | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-benchmark: | |
name: Run Benchmark | |
## runs-on: ubuntu-latest | |
runs-on: self-hosted | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Cache environment | |
id: cache-pip | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
~/.conda | |
/opt/conda | |
key: cache-${{ runner.os }}-${{ hashFiles('requirements.txt') }} | |
- name: Install Mambaforge | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Miniforge3 | |
use-mamba: true | |
activate-environment: omnibenchmark-env | |
python-version: "3.12" | |
auto-update-conda: true | |
channels: conda-forge | |
- name: Install omnibenchmark CLI | |
shell: bash -l {0} | |
run: | | |
mamba install -y pip | |
pip install git+https://github.com/omnibenchmark/omnibenchmark.git@dev | |
- name: Load benchmark cache | |
id: cache-benchmark | |
uses: actions/cache@v3 | |
with: | |
path: out/ | |
key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }} | |
- name: Run benchmark | |
shell: bash -l {0} | |
run: | | |
pwd | |
ls -lah | |
echo "y" | ob run benchmark -b Clustering.yaml --local --threads 20 --continue-on-error | |
upload-artifact: | |
name: Benchmark Artifact | |
## runs-on: ubuntu-latest | |
runs-on: self-hosted | |
needs: run-benchmark | |
if: always() | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Load cached output | |
uses: actions/cache@v3 | |
with: | |
path: out/ | |
key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }} | |
- name: Zip output folder | |
run: | | |
zip -r benchmark_output.zip out/ | |
- name: Upload zipped output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: benchmark-output | |
path: benchmark_output.zip | |
retention-days: 7 | |