Skip to content

Commit 1adf62b

Browse files
authored
Extend tests to other branches (#24)
Add a daily cronjob to try `main` and `dev` (and a shortlived hotfix branch) to install ob using miniforge and micromamba on a matrix of pythons/deps and run a small version of clustbench.
1 parent 7365821 commit 1adf62b

File tree

3 files changed

+271
-3
lines changed

3 files changed

+271
-3
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ concurrency:
44
cancel-in-progress: true
55

66
on:
7-
push:
8-
branches:
9-
- main
107
pull_request:
8+
branches:
9+
- 'main'
1110
workflow_dispatch:
1211

1312
permissions:

.github/workflows/micromamba.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: micromamba
2+
# concurrency:
3+
# group: ${{ github.head_ref || github.run_id }}
4+
# cancel-in-progress: true
5+
6+
on:
7+
pull_request:
8+
workflow_dispatch:
9+
schedule:
10+
# - cron: "*/30 * * * *" # Runs every 30 minutes for testing
11+
- cron: "30 1 * * *" # at 1.30am
12+
## these permissions are only for deployment to gh pages
13+
# permissions:
14+
# id-token: write
15+
# pages: write
16+
17+
jobs:
18+
run-benchmark-micromamba:
19+
name: run_clustbench_micromamba
20+
## runs-on: ubuntu-latest
21+
runs-on: self-hosted
22+
strategy:
23+
matrix:
24+
ob_branch: [dev, reduce_install_scope, main]
25+
micromamba-version: ['2.1.1-0', '2.0.5-0', '1.5.12-0', '1.5.8-0']
26+
fail-fast: false
27+
concurrency:
28+
group: micromamba-${{ matrix.micromamba-version }}-${{ matrix.ob_branch }}
29+
cancel-in-progress: false # true
30+
steps:
31+
- name: Check out repository
32+
uses: actions/checkout@v4
33+
34+
- name: Install (with) micromamba
35+
uses: mamba-org/setup-micromamba@v2
36+
with:
37+
cache-environment: false # true
38+
micromamba-version: ${{ matrix.micromamba-version }}
39+
download-micromamba: true
40+
micromamba-binary-path: ${{ runner.temp }}/bin/micromamba-${{ matrix.micromamba-version }}/micromamba
41+
environment-name: test-env-${{matrix.ob_branch }}-${{ matrix.micromamba-version }}
42+
create-args: >-
43+
python=3.12
44+
pip
45+
conda
46+
post-cleanup: environment # all
47+
- name: Overwrite omnibenchmark CLI to branch
48+
shell: bash -l {0}
49+
run: |
50+
micromamba --version
51+
pip install git+https://github.com/omnibenchmark/omnibenchmark.git@${{ matrix.ob_branch }}
52+
53+
# - name: Enable a benchmarking `out` cache
54+
# id: cache-benchmark
55+
# uses: actions/cache@v3
56+
# with:
57+
# path: out/
58+
# key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }}
59+
60+
- name: Run benchmark
61+
shell: bash -l {0}
62+
run: |
63+
env
64+
output=$( echo "y" | ob run benchmark -b Clustering.yaml --local --cores 10 2>&1 )
65+
status=$?
66+
if echo "$output" | grep -i 'Benchmark run has finished successfully'; then
67+
status=0
68+
fi
69+
echo -e $output
70+
sh -c "exit $status"
71+
if: matrix.ob_branch == 'dev' || matrix.ob_branch == 'reduce_install_scope'
72+
73+
- name: Run benchmark
74+
shell: bash -l {0}
75+
run: |
76+
env
77+
output=$( ob run benchmark -b Clustering.yaml --local --threads 10 2>&1 )
78+
status=$?
79+
if echo "$output" | grep -i 'Benchmark run has finished successfully'; then
80+
status=0
81+
fi
82+
echo -e $output
83+
sh -c "exit $status"
84+
if: matrix.ob_branch == 'main'
85+
86+
# upload-artifact:
87+
# name: Benchmark Artifact
88+
# runs-on: ubuntu-latest
89+
# ## runs-on: self-hosted
90+
# needs: run-benchmark
91+
# if: always()
92+
# steps:
93+
# - name: Check out repository
94+
# uses: actions/checkout@v4
95+
96+
# - name: Load cached output
97+
# uses: actions/cache@v3
98+
# with:
99+
# path: out/
100+
# key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }}
101+
102+
# - name: Prepare output
103+
# run: |
104+
# zip -r benchmark_output.zip out/
105+
# mkdir -p gh-pages
106+
# cp out/plotting/plotting_report.html gh-pages/index.html
107+
108+
# - name: Upload zipped output
109+
# uses: actions/upload-artifact@v4
110+
# with:
111+
# name: benchmark-output
112+
# path: benchmark_output.zip
113+
# retention-days: 7
114+
115+
# - name: Upload Pages Artifact
116+
# uses: actions/upload-pages-artifact@v3
117+
# with:
118+
# path: gh-pages
119+
120+
# - name: Deploy to GitHub Pages
121+
# uses: actions/deploy-pages@v4
122+
123+
# - name: Create Job Summary
124+
# if: always()
125+
# run: |
126+
# echo "### Reports" >> $GITHUB_STEP_SUMMARY
127+
# echo "- [Plotting Report](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }})" >> $GITHUB_STEP_SUMMARY
128+
# echo "### All Outputs" >> $GITHUB_STEP_SUMMARY
129+
# echo "- [Complete Benchmark Output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)" >> $GITHUB_STEP_SUMMARY
130+
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: clustbench_miniforge
2+
# concurrency:
3+
# group: ${{ github.head_ref || github.run_id }}
4+
# cancel-in-progress: true
5+
6+
on:
7+
pull_request:
8+
workflow_dispatch:
9+
schedule:
10+
# - cron: "*/30 * * * *" # Runs every 30 minutes for testing
11+
- cron: "30 1 * * *" # at 1.30am
12+
13+
## these permissions are only for deployment to gh pages
14+
# permissions:
15+
# id-token: write
16+
# pages: write
17+
18+
jobs:
19+
run-benchmark-miniforge:
20+
name: run_clustbench_miniforge
21+
## runs-on: ubuntu-latest
22+
runs-on: self-hosted
23+
strategy:
24+
matrix:
25+
ob_branch: [dev, reduce_install_scope, main]
26+
fail-fast: false
27+
concurrency:
28+
group: mambaforge-${{ matrix.ob_branch }}
29+
cancel-in-progress: false # true
30+
steps:
31+
- name: Check out repository
32+
uses: actions/checkout@v4
33+
34+
- name: Install Mambaforge
35+
uses: conda-incubator/setup-miniconda@v3
36+
with:
37+
miniforge-variant: Miniforge3
38+
use-mamba: true
39+
activate-environment: test-env-${{matrix.ob_branch }}
40+
python-version: "3.12"
41+
auto-update-conda: true
42+
channels: conda-forge
43+
44+
- name: Cache environment
45+
id: cache-env
46+
uses: actions/cache@v3
47+
with:
48+
path: |
49+
~/.conda/pkgs
50+
~/.conda/envs/omnibenchmark-env
51+
~/.cache/pip
52+
key: ${{ runner.os }}-conda-pip-${{ hashFiles('requirements.txt') }}
53+
restore-keys: |
54+
${{ runner.os }}-conda-pip-
55+
56+
- name: Install omnibenchmark CLI
57+
shell: bash -l {0}
58+
run: |
59+
mamba install -y pip
60+
pip install git+https://github.com/omnibenchmark/omnibenchmark.git@${{ matrix.ob_branch }}
61+
62+
# - name: Enable a benchmarking `out` cache
63+
# id: cache-benchmark
64+
# uses: actions/cache@v3
65+
# with:
66+
# path: out/
67+
# key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }}
68+
69+
- name: Run benchmark
70+
shell: bash -l {0}
71+
run: |
72+
env
73+
output=$( echo "y" | ob run benchmark -b Clustering.yaml --local --cores 10 2>&1 )
74+
status=$?
75+
if echo "$output" | grep -i 'Benchmark run has finished successfully'; then
76+
status=0
77+
fi
78+
echo -e $output
79+
sh -c "exit $status"
80+
if: matrix.ob_branch == 'dev' || matrix.ob_branch == 'reduce_install_scope'
81+
82+
- name: Run benchmark
83+
shell: bash -l {0}
84+
run: |
85+
env
86+
output=$( ob run benchmark -b Clustering.yaml --local --threads 10 2>&1 )
87+
status=$?
88+
if echo "$output" | grep -i 'Benchmark run has finished successfully'; then
89+
status=0
90+
fi
91+
echo -e $output
92+
sh -c "exit $status"
93+
if: matrix.ob_branch == 'main'
94+
95+
# upload-artifact:
96+
# name: Benchmark Artifact
97+
# runs-on: ubuntu-latest
98+
# ## runs-on: self-hosted
99+
# needs: run-benchmark
100+
# if: always()
101+
# steps:
102+
# - name: Check out repository
103+
# uses: actions/checkout@v4
104+
105+
# - name: Load cached output
106+
# uses: actions/cache@v3
107+
# with:
108+
# path: out/
109+
# key: benchmark-${{ runner.os }}-${{ hashFiles('Clustering.yaml') }}
110+
111+
# - name: Prepare output
112+
# run: |
113+
# zip -r benchmark_output.zip out/
114+
# mkdir -p gh-pages
115+
# cp out/plotting/plotting_report.html gh-pages/index.html
116+
117+
# - name: Upload zipped output
118+
# uses: actions/upload-artifact@v4
119+
# with:
120+
# name: benchmark-output
121+
# path: benchmark_output.zip
122+
# retention-days: 7
123+
124+
# - name: Upload Pages Artifact
125+
# uses: actions/upload-pages-artifact@v3
126+
# with:
127+
# path: gh-pages
128+
129+
# - name: Deploy to GitHub Pages
130+
# uses: actions/deploy-pages@v4
131+
132+
# - name: Create Job Summary
133+
# if: always()
134+
# run: |
135+
# echo "### Reports" >> $GITHUB_STEP_SUMMARY
136+
# echo "- [Plotting Report](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }})" >> $GITHUB_STEP_SUMMARY
137+
# echo "### All Outputs" >> $GITHUB_STEP_SUMMARY
138+
# echo "- [Complete Benchmark Output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)" >> $GITHUB_STEP_SUMMARY
139+

0 commit comments

Comments
 (0)