Skip to content

Commit 70dbcda

Browse files
committed
feat: add CodSpeed to the project
1 parent f4cee67 commit 70dbcda

3 files changed

Lines changed: 358 additions & 399 deletions

File tree

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
name: Benchmarks
2-
32
on:
43
push:
54
branches:
6-
- main
7-
- "*.x.x"
8-
merge_group:
9-
10-
# since we're writing to cloud storage, we don't want to have multiple
11-
# instances of this job running at one time
12-
concurrency: benchmarks-${{ github.repository }}
13-
14-
permissions:
15-
# increase the rate limit for github operations, but limit token permissions
16-
# to read-only
17-
contents: read
5+
- "main" # or "master"
6+
pull_request:
7+
# `workflow_dispatch` allows CodSpeed to trigger backtest
8+
# performance analysis in order to generate initial data.
9+
workflow_dispatch:
1810

1911
jobs:
2012
benchmarks:
@@ -38,47 +30,8 @@ jobs:
3830
- name: install ibis
3931
run: poetry install --without dev --without docs --all-extras
4032

41-
- name: make benchmark output dir
42-
run: mkdir .benchmarks
43-
44-
- name: benchmark
45-
run: poetry run pytest --benchmark-enable --benchmark-json .benchmarks/output.json ibis/tests/benchmarks
46-
47-
- uses: google-github-actions/auth@v2
33+
- name: Run benchmarks
34+
uses: CodSpeedHQ/action@v2
4835
with:
49-
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
50-
51-
- uses: google-github-actions/setup-gcloud@v2
52-
53-
- name: show gcloud info
54-
run: gcloud info
55-
56-
- name: download the latest duckdb release
57-
env:
58-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
run: |
60-
set -euo pipefail
61-
62-
gh release download -R duckdb/duckdb --pattern 'duckdb_cli-linux-amd64.zip'
63-
unzip duckdb_cli-linux-amd64.zip
64-
65-
- name: convert json data to parquet
66-
run: |
67-
set -euo pipefail
68-
69-
# sort json keys
70-
jq --sort-keys -rcM < "$PWD/.benchmarks/output.json" > output.json
71-
72-
# connect to a file to allow spilling to disk
73-
./duckdb json2parquet.ddb <<EOF
74-
COPY (
75-
SELECT * FROM read_ndjson_auto('output.json', maximum_object_size=2**27)
76-
) TO 'output.parquet' (FORMAT PARQUET, COMPRESSION ZSTD)
77-
EOF
78-
79-
- name: copy data to gcs
80-
run: |
81-
set -euo pipefail
82-
83-
timestamp="$(date --iso-8601=ns --utc | tr ',' '.')"
84-
gsutil cp output.parquet "gs://ibis-benchmark-data/ci/${timestamp}.parquet"
36+
token: ${{ secrets.CODSPEED_TOKEN }}
37+
run: poetry run pytest --benchmark-enable ibis/tests/benchmarks

0 commit comments

Comments
 (0)