Skip to content

Commit 1ce9cb0

Browse files
committed
refactor: (GH-apache#85) Changes in benchmark after review-3
Signed-off-by: Saurabh Kumar Singh <[email protected]>
1 parent 4dc951e commit 1ce9cb0

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/benchmark.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ name: Benchmarks
1919
on:
2020
push:
2121
branches: [main]
22+
pull_request:
23+
branches: [main]
2224
paths:
2325
- ".github/workflows/benchmark.yml"
2426
- "ci/scripts/bench_adapt.py"
@@ -35,6 +37,10 @@ jobs:
3537
arch: ['amd64']
3638
steps:
3739
- uses: actions/checkout@v4
40+
- name: Install dependencies
41+
run: |
42+
apt-get update
43+
apt-get install -y ca-certificates curl
3844
- name: Set up Python
3945
uses: actions/setup-python@v4
4046
with:
@@ -45,9 +51,10 @@ jobs:
4551
go-version: ${{ matrix.go }}
4652
cache: true
4753
cache-dependency-path: go.sum
54+
check-latest: false
4855
- name: Run Benchmarks
49-
run: |
50-
ci/scripts/bench.sh --json
56+
if: github.event_name != 'push'
57+
run: bash ci/scripts/bench.sh . --json
5158
- name: Upload results
5259
if: github.event_name == 'push' && github.repository == 'apache/arrow-go' && github.ref_name == 'main'
5360
env:

ci/scripts/bench.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,25 @@
2323

2424
set -ex
2525

26-
source_dir=${1}
26+
# Validate input arguments
27+
if [ -z "$1" ]; then
28+
echo "Error: Missing source directory argument"
29+
exit 1
30+
fi
31+
32+
source_dir="$1"
33+
34+
PARQUET_TEST_DATA="${source_dir}/cpp/submodules/parquet-testing/data"
35+
36+
# If parquet_test_data doesn't exist, download it from Apache Arrow GitHub
37+
if [ ! -d "$PARQUET_TEST_DATA" ]; then
38+
echo "parquet_test_data not found. Fetching from Apache Arrow repository..."
39+
mkdir -p "$PARQUET_TEST_DATA"
40+
curl -L https://github.com/apache/parquet-testing/tree/master/data
41+
fi
42+
43+
export PARQUET_TEST_DATA
2744

28-
export PARQUET_TEST_DATA=${1}/cpp/submodules/parquet-testing/data
2945
pushd "${source_dir}"
3046

3147
# lots of benchmarks, they can take a while

0 commit comments

Comments
 (0)