|
1 | 1 | name: Benchmarks |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | 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: |
18 | 10 |
|
19 | 11 | jobs: |
20 | 12 | benchmarks: |
|
38 | 30 | - name: install ibis |
39 | 31 | run: poetry install --without dev --without docs --all-extras |
40 | 32 |
|
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 |
48 | 35 | 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