forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 3.06 KB
/
reuse.explain.yml
File metadata and controls
86 lines (76 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Explain
on:
workflow_call:
inputs:
run_id:
description: The run id for explain
required: true
type: string
version:
description: The version of databend to explain
required: true
type: string
permissions:
id-token: write
pull-requests: write
contents: read
jobs:
cloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_bendsql
- name: Get Latest Release
id: latest
env:
GH_TOKEN: ${{ github.token }}
run: |
version_latest=$(gh api /repos/databendlabs/databend/releases/latest | jq -r '.tag_name')
echo "version=${version_latest}" >> $GITHUB_OUTPUT
echo "Compare explain: ${{ inputs.version }} vs ${version_latest}" >> $GITHUB_STEP_SUMMARY
- name: Create Warehouse Base
id: warehouse-base
env:
CLOUD_USER: ${{ secrets.BENCHMARK_CLOUD_USER }}
CLOUD_PASSWORD: ${{ secrets.BENCHMARK_CLOUD_PASSWORD }}
CLOUD_GATEWAY: ${{ secrets.BENCHMARK_CLOUD_GATEWAY }}
WAREHOUSE_SIZE: XSmall
WAREHOUSE_VERSION: ${{ steps.latest.outputs.version }}
WAREHOUSE_NAME: explain-${{ inputs.run_id }}-base
run: |
./scripts/ci/cloud/create_warehouse.sh
echo "name=${WAREHOUSE_NAME}" >> $GITHUB_OUTPUT
echo "dsn=databend://${CLOUD_USER}:${CLOUD_PASSWORD}@${CLOUD_GATEWAY}:443/explain?warehouse=${WAREHOUSE_NAME}" >> $GITHUB_OUTPUT
- name: Create Warehouse Compare
id: warehouse-compare
env:
CLOUD_USER: ${{ secrets.BENCHMARK_CLOUD_USER }}
CLOUD_PASSWORD: ${{ secrets.BENCHMARK_CLOUD_PASSWORD }}
CLOUD_GATEWAY: ${{ secrets.BENCHMARK_CLOUD_GATEWAY }}
WAREHOUSE_SIZE: XSmall
WAREHOUSE_VERSION: ${{ inputs.version }}
WAREHOUSE_NAME: explain-${{ inputs.run_id }}-compare
run: |
./scripts/ci/cloud/create_warehouse.sh
echo "name=${WAREHOUSE_NAME}" >> $GITHUB_OUTPUT
echo "dsn=databend://${CLOUD_USER}:${CLOUD_PASSWORD}@${CLOUD_GATEWAY}:443/explain?warehouse=${WAREHOUSE_NAME}" >> $GITHUB_OUTPUT
- name: Run ExplainB Analysis
uses: BohuTANG/explainb-action@v0.1.0
with:
bendsql-dsn1: ${{ steps.warehouse-base.outputs.dsn }}
bendsql-dsn2: ${{ steps.warehouse-compare.outputs.dsn }}
runbend: 'true'
verbose: 'true'
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: explainb-report
path: report.html
- name: clean
if: always()
continue-on-error: true
env:
BENDSQL_DSN: "databend://${{ secrets.BENCHMARK_CLOUD_USER }}:${{ secrets.BENCHMARK_CLOUD_PASSWORD }}@${{ secrets.BENCHMARK_CLOUD_GATEWAY }}:443/?warehouse=default"
run: |
echo "DROP WAREHOUSE IF EXISTS '${{ steps.warehouse-base.outputs.name }}';" | bendsql -o table
echo "DROP WAREHOUSE IF EXISTS '${{ steps.warehouse-compare.outputs.name }}';" | bendsql -o table