qe: support _count
in joined queries
#497
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "QE: WASM size" | |
on: | |
pull_request: | |
paths-ignore: | |
- ".github/**" | |
- "!.github/workflows/wasm-size.yml" | |
- ".buildkite/**" | |
- "*.md" | |
- "LICENSE" | |
- "CODEOWNERS" | |
- "renovate.json" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pr-wasm-size: | |
name: calculate module size (pr) | |
runs-on: ubuntu-latest | |
outputs: | |
size: ${{ steps.measure.outputs.size }} | |
size_gz: ${{ steps.measure.outputs.size_gz }} | |
steps: | |
- name: Checkout PR branch | |
uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v24 | |
- name: Build and measure PR branch | |
id: measure | |
run: | | |
nix build -L .#query-engine-wasm .#query-engine-wasm-gz | |
echo "size=$(wc --bytes < ./result/query_engine_bg.wasm)" >> $GITHUB_OUTPUT | |
echo "size_gz=$(wc --bytes < ./result-1/query_engine_bg.wasm.gz)" >> $GITHUB_OUTPUT | |
base-wasm-size: | |
name: calculate module size (main) | |
runs-on: ubuntu-latest | |
outputs: | |
size: ${{ steps.measure.outputs.size }} | |
size_gz: ${{ steps.measure.outputs.size_gz }} | |
steps: | |
- name: Checkout base branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.base.sha }} | |
- uses: cachix/install-nix-action@v24 | |
- name: Build and measure base branch | |
id: measure | |
run: | | |
nix build -L .#query-engine-wasm .#query-engine-wasm-gz | |
echo "size=$(wc --bytes < ./result/query_engine_bg.wasm)" >> $GITHUB_OUTPUT | |
echo "size_gz=$(wc --bytes < ./result-1/query_engine_bg.wasm.gz)" >> $GITHUB_OUTPUT | |
report-diff: | |
name: report module size | |
runs-on: ubuntu-latest | |
needs: | |
- pr-wasm-size | |
- base-wasm-size | |
steps: | |
- name: Compute difference | |
id: compute | |
run: | | |
base=$(echo "${{ needs.base-wasm-size.outputs.size }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
base_gz=$(echo "${{ needs.base-wasm-size.outputs.size_gz }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
pr=$(echo "${{ needs.pr-wasm-size.outputs.size }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
pr_gz=$(echo "${{ needs.pr-wasm-size.outputs.size_gz }}" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
diff=$(echo "$((${{ needs.pr-wasm-size.outputs.size }} - ${{ needs.base-wasm-size.outputs.size }}))" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
diff_gz=$(echo "$((${{ needs.pr-wasm-size.outputs.size_gz }} - ${{ needs.base-wasm-size.outputs.size_gz }}))" | numfmt --format '%.3f' --to=iec-i --suffix=B) | |
echo "base=$base" >> $GITHUB_OUTPUT | |
echo "base_gz=$base_gz" >> $GITHUB_OUTPUT | |
echo "pr=$pr" >> $GITHUB_OUTPUT | |
echo "pr_gz=$pr_gz" >> $GITHUB_OUTPUT | |
echo "diff=$diff" >> $GITHUB_OUTPUT | |
echo "diff_gz=$diff_gz" >> $GITHUB_OUTPUT | |
- name: Find past report comment | |
uses: peter-evans/find-comment@v2 | |
id: findReportComment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body-includes: "<!-- wasm-size -->" | |
- 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: | | |
<!-- wasm-size --> | |
### WASM Size | |
|Engine | This PR | Base branch | Diff | |
|--------------|-----------------------------------|--------------------------------------|------------------------------------ | |
| WASM | ${{ steps.compute.outputs.pr}} | ${{ steps.compute.outputs.base}} | ${{ steps.compute.outputs.diff}} | |
| WASM (gzip) | ${{ steps.compute.outputs.pr_gz}} | ${{ steps.compute.outputs.base_gz}} | ${{ steps.compute.outputs.diff_gz}} | |
edit-mode: replace |