forked from equinor/segyio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
105 lines (93 loc) · 3.08 KB
/
Copy pathaction.yaml
File metadata and controls
105 lines (93 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Benchmark
description: benchmark execution
inputs:
ref:
description: ref to checkout
compare:
description: results comparison string
default: --benchmark-compare=0001 --benchmark-compare-fail=min:25% --benchmark-group-by=fullname --color=yes
datasource:
description: datasource to run on
default: default
runs:
using: "composite"
steps:
- name: Print available disk space
shell: bash
run: df -h
- name: Checkout commit which performance should be measured
shell: bash
run: |
git restore .
git fetch origin ${{ inputs.ref }} --depth 1
git checkout ${{ inputs.ref }}
- name: Build wheel
shell: bash
env:
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --only cp312-manylinux_x86_64 --output-dir ./wheelhouse python/
- name: Install local wheel
shell: bash
run: |
pip install ./wheelhouse/*.whl
rm -f ./wheelhouse/*.whl
- name: Checkout current commit which contains all tests to run
shell: bash
run: git checkout ${{ github.sha }}
# assure that local segyio doesn't take priority (one installed to pip is used)
- name: Remove local segyio
shell: bash
working-directory: python
run: |
python -c "import segyio; import inspect; print('before: segyio loaded from ' + inspect.getfile(segyio))"
rm -rf $(pwd)/segyio
python -c "import segyio; import inspect; print('after: segyio loaded from ' + inspect.getfile(segyio))"
- name: Make segy file
if: ${{ inputs.datasource == 'default' }}
shell: bash
working-directory: python
run: |
if [ ! -f file.sgy ]; then
time python -m examples.make-file file.sgy 1600 1 1000 1 1200
else
echo "file.sgy already exists"
fi
ls -lh file.sgy
- name: Make segy small file
shell: bash
working-directory: python
run: |
if [ ! -f file-small.sgy ]; then
time python -m examples.make-file file-small.sgy 500 1 350 1 350
else
echo "file-small.sgy already exists"
fi
ls -lh file-small.sgy
- name: Run benchmark tests
if: ${{ inputs.datasource == 'default' }}
shell: bash
working-directory: python
run: |
pytest test/benchmarks.py -rP --benchmark-sort=name --benchmark-autosave ${{ inputs.compare }}
- name: Run benchmark tests on datasource
if: ${{ inputs.datasource != 'default' }}
shell: bash
working-directory: python
run: |
pytest \
test/benchmarks.py::test_read_speed \
test/benchmarks.py::test_cube_speed \
test/benchmarks.py::test_write_file \
-rP \
--datasource ${{ inputs.datasource }} \
--readf file-small.sgy \
--writef file-small.sgy \
--benchmark-sort=name \
--benchmark-autosave \
${{ inputs.compare }}
- name: Remove build artifacts
shell: bash
run: |
git clean -df --exclude=.benchmarks
pip uninstall -y segyio