Skip to content

Commit 3299427

Browse files
authored
Merge pull request #609 from achaikou/fix_benchmark_ci
Fix benchmark CI
2 parents 0beb3c1 + 3ca438f commit 3299427

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/actions/benchmark/action.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,36 @@ runs:
1818
- name: Checkout commit which performance should be measured
1919
shell: bash
2020
run: |
21+
git restore .
2122
git fetch origin ${{ inputs.ref }} --depth 1
2223
git checkout ${{ inputs.ref }}
2324
24-
- name: Configure
25+
- name: Build wheel
2526
shell: bash
27+
env:
28+
CIBW_BUILD_VERBOSITY: 1
2629
run: |
27-
cmake -S . -B build \
28-
-DBUILD_PYTHON=ON \
29-
-DBUILD_SHARED_LIBS=ON \
30-
-DCMAKE_BUILD_TYPE=Release \
30+
python -m cibuildwheel --only cp312-manylinux_x86_64 --output-dir ./wheelhouse python/
3131
32-
- name: Build
32+
- name: Install local wheel
3333
shell: bash
3434
run: |
35-
cmake \
36-
--build build \
37-
--config Release \
38-
39-
- name: Set PYTHONPATH
40-
shell: bash
41-
run: echo "PYTHONPATH=$(pwd)/python" >> $GITHUB_ENV
35+
pip install ./wheelhouse/*.whl
36+
rm -f ./wheelhouse/*.whl
4237
4338
- name: Checkout current commit which contains all tests to run
4439
shell: bash
4540
run: git checkout ${{ github.sha }}
4641

42+
# assure that local segyio doesn't take priority (one installed to pip is used)
43+
- name: Remove local segyio
44+
shell: bash
45+
working-directory: python
46+
run: |
47+
python -c "import segyio; import inspect; print('before: segyio loaded from ' + inspect.getfile(segyio))"
48+
rm -rf $(pwd)/segyio
49+
python -c "import segyio; import inspect; print('after: segyio loaded from ' + inspect.getfile(segyio))"
50+
4751
- name: Make segy file
4852
shell: bash
4953
working-directory: python
@@ -79,4 +83,6 @@ runs:
7983
8084
- name: Remove build artifacts
8185
shell: bash
82-
run: git clean -df --exclude=.benchmarks
86+
run: |
87+
git clean -df --exclude=.benchmarks
88+
pip uninstall -y segyio

.github/workflows/benchmarks.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22+
- name: Install cibuildwheel
23+
run: python3 -m pip install cibuildwheel
24+
2225
- name: Install build/test dependencies
23-
shell: bash
2426
working-directory: python
2527
run: |
2628
python3 -m pip install -r requirements-dev.txt

0 commit comments

Comments
 (0)