Skip to content

Commit

Permalink
Run in GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Dec 15, 2023
1 parent 7b6ecda commit 0c63fac
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
88 changes: 88 additions & 0 deletions .github/workflows/qe-perf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Report qe benchmarks
on:
pull_request:
paths-ignore:
- ".github/**"
- "!.github/workflows/wasm-perf.yml"
- ".buildkite/**"
- "*.md"
- "LICENSE"
- "CODEOWNERS"
- "renovate.json"

jobs:
run-benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
outputs:
results: ${{ steps.bench.outputs.results }}
steps:
- name: Checkout PR branch
uses: actions/checkout@v4

- name: "Setup Node.js"
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: "Setup pnpm"
uses: pnpm/action-setup@v2
with:
version: 8

- name: "Get pnpm store directory"
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: "Login to Docker Hub"
uses: docker/login-action@v3
continue-on-error: true
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: dtolnay/rust-toolchain@stable

- name: Install wasm-pack
run: cargo install wasm-pack

- name: Setup benchmark
run: make setup-pg-bench

- name: Run benchmarks
id: bench
run: |
echo "results=$(make run-bench)\n" >> $GITHUB_OUTPUT
report:
name: Report benchmarks
runs-on: ubuntu-latest
needs:
- run-benchmarks

steps:
- name: Find past report comment
uses: peter-evans/find-comment@v2
id: findReportComment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "<!-- qe-benchmarks -->"

- name: Create or update report
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.findReportComment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- qe-benchmarks -->
### Query engine benchmark results
```sh
${{ needs.run-benchmarks.outputs.results}}
```
edit-mode: replace
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ test-driver-adapter-pg-wasm: test-pg-wasm
start-pg-bench:
docker compose -f query-engine/driver-adapters/executor/bench/docker-compose.yml up --wait -d --remove-orphans postgres

setup-pg-bench: start-pg-bench build-qe-napi build-qe-wasm build-driver-adapters-kit

run-bench:
query-engine/driver-adapters/executor/script/bench.sh

bench-pg-js: start-pg-bench build-qe-napi build-qe-wasm build-driver-adapters-kit run-bench
bench-pg-js: setup-pg-bench run-bench

start-neon-js:
docker compose -f docker-compose.yml up --wait -d --remove-orphans neon-proxy
Expand Down

0 comments on commit 0c63fac

Please sign in to comment.